#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/route.h>
#include <netinet/in.h>
#include <arpa/inet.h>

#include "onvifH.h"
#include "onvifStub.h"
#include "../interface/boa_interface.h"



static enum xsd__boolean xsd_true = xsd__boolean__true_;
static enum xsd__boolean xsd_false = xsd__boolean__false_;


#define ONVIF_SERVER_CALL()    printf("onvifs: call %s, path=%s\r\n", __FUNCTION__, soap->path)

#define ONVIF_RETURN_OK(soap, namespaces)   \
	ONVIF_SERVER_CALL();    \
	if(namespaces!=NULL) soap_set_namespaces(soap, namespaces);  \
	return SOAP_OK;

#define ONVIF_NOTSUPPORTED_FUNC(soap, namespaces)   \
	ONVIF_SERVER_CALL();    \
	if(namespaces!=NULL) soap_set_namespaces(soap, namespaces);  \
	return soap_receiver_fault_subcode(soap, "ter:ActionNotSupported", "Optional Action Not Implemented ", "The requested action is optional and is not implemented by the device.");
	
static inline int onvif_receiver_fault_subcode_oom(struct soap *soap)
{
	return soap_receiver_fault_subcode(soap, "ter:OutofMemory", "Out of Memory", "The device does not have sufficient memory to complete the action.");
}

int onvif_fault(struct soap *soap,char *value1,char *value2)
{
	soap->fault = (struct SOAP_ENV__Fault*)soap_malloc(soap,(sizeof(struct SOAP_ENV__Fault)));
	soap->fault->SOAP_ENV__Code = (struct SOAP_ENV__Code*)soap_malloc(soap,(sizeof(struct SOAP_ENV__Code)));
	soap->fault->SOAP_ENV__Code->SOAP_ENV__Value = "SOAP-ENV:Sender";
	soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode = (struct SOAP_ENV__Code*)soap_malloc(soap,(sizeof(struct SOAP_ENV__Code)));;
	soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Value = value1;
	soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Subcode = (struct SOAP_ENV__Code*)soap_malloc(soap,(sizeof(struct SOAP_ENV__Code)));
	soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Subcode->SOAP_ENV__Value = value2;
	soap->fault->SOAP_ENV__Code->SOAP_ENV__Subcode->SOAP_ENV__Subcode->SOAP_ENV__Subcode = NULL;
	soap->fault->faultcode = NULL;
	soap->fault->faultstring = NULL;
	soap->fault->faultactor = NULL;
	soap->fault->detail = NULL;
	soap->fault->SOAP_ENV__Reason = NULL;
	soap->fault->SOAP_ENV__Node = NULL;
	soap->fault->SOAP_ENV__Role = NULL;
	soap->fault->SOAP_ENV__Detail = NULL;
}


/* @brief Check if IP is valid */
int isValidIp4 (char *str) 
{
	int segs = 0;   /* Segment count. */     
	int chcnt = 0;  /* Character count within segment. */     
	int accum = 0;  /* Accumulator for segment. */      
	/* Catch NULL pointer. */      
	if (str == NULL) return 0;      
	/* Process every character in string. */      
	while (*str != '\0') 
	{         
		/* Segment changeover. */          
		if (*str == '.') 
		{             
			/* Must have some digits in segment. */              
			if (chcnt == 0) return 0;              
			/* Limit number of segments. */              
			if (++segs == 4) return 0;              
			/* Reset segment values and restart loop. */              
			chcnt = accum = 0;             
			str++;             
			continue;         
		}  

		/* Check numeric. */          
		if ((*str < '0') || (*str > '9')) return 0;
		/* Accumulate and check segment. */          
		if ((accum = accum * 10 + *str - '0') > 255) return 0;
		/* Advance other segment specific stuff and continue loop. */          
		chcnt++;         
		str++;     
	}      
	/* Check enough segments and enough characters in last segment. */      
	if (segs != 3) return 0;      
	if (chcnt == 0) return 0;      
	/* Address okay. */      
	return 1; 
}



SOAP_FMAC5 int SOAP_FMAC6 SOAP_ENV__Fault(struct soap* soap, char *faultcode, char *faultstring, char *faultactor, struct SOAP_ENV__Detail *detail, struct SOAP_ENV__Code *SOAP_ENV__Code, struct SOAP_ENV__Reason *SOAP_ENV__Reason, char *SOAP_ENV__Node, char *SOAP_ENV__Role, struct SOAP_ENV__Detail *SOAP_ENV__Detail)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __wsdd__Hello(struct soap* soap, struct wsdd__HelloType *wsdd__Hello)
{
	ONVIF_NOTSUPPORTED_FUNC(soap,namespaces)(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __wsdd__Bye(struct soap* soap, struct wsdd__ByeType *wsdd__Bye)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __wsdd__Probe(struct soap* soap, struct wsdd__ProbeType *wsdd__Probe)
{
	//wsr add
	fprintf(stderr,"[%d] __wsdd__Probe start !\n", __LINE__);

	//unsigned char macaddr[6] = {0};
	char _IPAddr[INFO_LENGTH] = {0};
	char _HwId[1024] = {0};

	wsdd__ProbeMatchesType ProbeMatches;
	ProbeMatches.ProbeMatch = (struct wsdd__ProbeMatchType *)soap_malloc(soap, sizeof(struct wsdd__ProbeMatchType));
	ProbeMatches.ProbeMatch->XAddrs = (char *)soap_malloc(soap, sizeof(char) * INFO_LENGTH);
	ProbeMatches.ProbeMatch->Types = (char *)soap_malloc(soap, sizeof(char) * INFO_LENGTH);
	ProbeMatches.ProbeMatch->Scopes = (struct wsdd__ScopesType*)soap_malloc(soap,sizeof(struct wsdd__ScopesType));
	ProbeMatches.ProbeMatch->wsa__EndpointReference.ReferenceProperties = (struct wsa__ReferencePropertiesType*)soap_malloc(soap,sizeof(struct wsa__ReferencePropertiesType));
	ProbeMatches.ProbeMatch->wsa__EndpointReference.ReferenceParameters = (struct wsa__ReferenceParametersType*)soap_malloc(soap,sizeof(struct wsa__ReferenceParametersType));
	ProbeMatches.ProbeMatch->wsa__EndpointReference.ServiceName = (struct wsa__ServiceNameType*)soap_malloc(soap,sizeof(struct wsa__ServiceNameType));
	ProbeMatches.ProbeMatch->wsa__EndpointReference.PortType = (char **)soap_malloc(soap, sizeof(char *) * SMALL_INFO_LENGTH);
	ProbeMatches.ProbeMatch->wsa__EndpointReference.__any = (char **)soap_malloc(soap, sizeof(char*) * SMALL_INFO_LENGTH);
	ProbeMatches.ProbeMatch->wsa__EndpointReference.__anyAttribute = (char *)soap_malloc(soap, sizeof(char) * SMALL_INFO_LENGTH);
	ProbeMatches.ProbeMatch->wsa__EndpointReference.Address = (char *)soap_malloc(soap, sizeof(char) * INFO_LENGTH);

	//netGetMac("eth1", macaddr); //eth0  根据实际情况填充
	//macaddr[0]=0x01;macaddr[1]=0x01;macaddr[2]=0x01;macaddr[3]=0x01;macaddr[4]=0x01;macaddr[5]=0x01;
	//sprintf(_HwId,"urn:uuid:2419d68a-2dd2-21b2-a205-%02X%02X%02X%02X%02X%02X",macaddr[0], macaddr[1], macaddr[2], macaddr[3], macaddr[4], macaddr[5]);
	sprintf(_HwId,"urn:uuid:2419d68a-2dd2-21b2-a205-%s",onvifConfig.NET.Mac);


	//unsigned int localIp = 0;
	//netGetIp("eth1", &localIp); //eth0 根据实际情况填充
	//sprintf(_IPAddr, "http://%s/onvif/device_service", inet_ntoa(*((struct in_addr *)&localIp)));
	//printf("%s--%s--- _IPAddr ==== %s\n", __FILE__,__func__, _IPAddr);

	sprintf(_IPAddr, "http://%s/onvif/device_service", onvifConfig.NET.IP);

	ProbeMatches.__sizeProbeMatch = 1;
	ProbeMatches.ProbeMatch->Scopes->__item =(char *)soap_malloc(soap, 1024);
	memset(ProbeMatches.ProbeMatch->Scopes->__item,0,sizeof(ProbeMatches.ProbeMatch->Scopes->__item));

	//Scopes MUST BE
	strcat(ProbeMatches.ProbeMatch->Scopes->__item, "onvif://www.onvif.org/type/NetworkVideoTransmitter");

	ProbeMatches.ProbeMatch->Scopes->MatchBy = NULL;
	strcpy(ProbeMatches.ProbeMatch->XAddrs, _IPAddr);//webserver服务的url
	strcpy(ProbeMatches.ProbeMatch->Types, wsdd__Probe->Types);
	//printf("wsdd__Probe->Types=%s\n",wsdd__Probe->Types);
	ProbeMatches.ProbeMatch->MetadataVersion = 1;//版本号

	//ws-discovery规定 为可选项
	ProbeMatches.ProbeMatch->wsa__EndpointReference.ReferenceProperties->__size = 0;
	ProbeMatches.ProbeMatch->wsa__EndpointReference.ReferenceProperties->__any = NULL;
	ProbeMatches.ProbeMatch->wsa__EndpointReference.ReferenceParameters->__size = 0;
	ProbeMatches.ProbeMatch->wsa__EndpointReference.ReferenceParameters->__any = NULL;

	ProbeMatches.ProbeMatch->wsa__EndpointReference.PortType[0] = (char *)soap_malloc(soap, sizeof(char) * SMALL_INFO_LENGTH);
	//ws-discovery规定 为可选项
	strcpy(ProbeMatches.ProbeMatch->wsa__EndpointReference.PortType[0], "ttl");
	ProbeMatches.ProbeMatch->wsa__EndpointReference.ServiceName->__item = NULL;
	ProbeMatches.ProbeMatch->wsa__EndpointReference.ServiceName->PortName = NULL;
	ProbeMatches.ProbeMatch->wsa__EndpointReference.ServiceName->__anyAttribute = NULL;
	ProbeMatches.ProbeMatch->wsa__EndpointReference.__any[0] = (char *)soap_malloc(soap, sizeof(char) * SMALL_INFO_LENGTH);
	strcpy(ProbeMatches.ProbeMatch->wsa__EndpointReference.__any[0], "Any");
	strcpy(ProbeMatches.ProbeMatch->wsa__EndpointReference.__anyAttribute, "Attribute");
	ProbeMatches.ProbeMatch->wsa__EndpointReference.__size = 0;
	strcpy(ProbeMatches.ProbeMatch->wsa__EndpointReference.Address, _HwId);

	soap->header->wsa__To = "http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous";
	soap->header->wsa__Action = "http://schemas.xmlsoap.org/ws/2005/04/discovery/ProbeMatches";
	soap->header->wsa__RelatesTo = (struct wsa__Relationship*)soap_malloc(soap, sizeof(struct wsa__Relationship));
	soap->header->wsa__RelatesTo->__item = soap->header->wsa__MessageID;
	soap->header->wsa__RelatesTo->RelationshipType = NULL;
	soap->header->wsa__RelatesTo->__anyAttribute = NULL;

	soap->header->wsa5__MessageID = NULL;
	soap->header->wsa5__To= NULL;
	soap->header->wsa5__Action = NULL;
	soap->header->wsa__MessageID =(char *)soap_malloc(soap, sizeof(char) * INFO_LENGTH);
	strcpy(soap->header->wsa__MessageID,_HwId+4);

    	if (SOAP_OK == soap_send___wsdd__ProbeMatches(soap, "http://", NULL, &ProbeMatches))
    	{
		printf("send ProbeMatches success !\n");
		return SOAP_OK;
	}

	printf("[%d] soap error: %d, %s, %s\n", __LINE__, soap->error, *soap_faultcode(soap), *soap_faultstring(soap));

	return soap->error;
	//ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __wsdd__ProbeMatches(struct soap* soap, struct wsdd__ProbeMatchesType *wsdd__ProbeMatches)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __wsdd__Resolve(struct soap* soap, struct wsdd__ResolveType *wsdd__Resolve)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __wsdd__ResolveMatches(struct soap* soap, struct wsdd__ResolveMatchesType *wsdd__ResolveMatches)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tad__GetServiceCapabilities(struct soap* soap, struct _tad__GetServiceCapabilities *tad__GetServiceCapabilities, struct _tad__GetServiceCapabilitiesResponse *tad__GetServiceCapabilitiesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tad__DeleteAnalyticsEngineControl(struct soap* soap, struct _tad__DeleteAnalyticsEngineControl *tad__DeleteAnalyticsEngineControl, struct _tad__DeleteAnalyticsEngineControlResponse *tad__DeleteAnalyticsEngineControlResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tad__CreateAnalyticsEngineControl(struct soap* soap, struct _tad__CreateAnalyticsEngineControl *tad__CreateAnalyticsEngineControl, struct _tad__CreateAnalyticsEngineControlResponse *tad__CreateAnalyticsEngineControlResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tad__SetAnalyticsEngineControl(struct soap* soap, struct _tad__SetAnalyticsEngineControl *tad__SetAnalyticsEngineControl, struct _tad__SetAnalyticsEngineControlResponse *tad__SetAnalyticsEngineControlResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tad__GetAnalyticsEngineControl(struct soap* soap, struct _tad__GetAnalyticsEngineControl *tad__GetAnalyticsEngineControl, struct _tad__GetAnalyticsEngineControlResponse *tad__GetAnalyticsEngineControlResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tad__GetAnalyticsEngineControls(struct soap* soap, struct _tad__GetAnalyticsEngineControls *tad__GetAnalyticsEngineControls, struct _tad__GetAnalyticsEngineControlsResponse *tad__GetAnalyticsEngineControlsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tad__GetAnalyticsEngine(struct soap* soap, struct _tad__GetAnalyticsEngine *tad__GetAnalyticsEngine, struct _tad__GetAnalyticsEngineResponse *tad__GetAnalyticsEngineResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tad__GetAnalyticsEngines(struct soap* soap, struct _tad__GetAnalyticsEngines *tad__GetAnalyticsEngines, struct _tad__GetAnalyticsEnginesResponse *tad__GetAnalyticsEnginesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tad__SetVideoAnalyticsConfiguration(struct soap* soap, struct _tad__SetVideoAnalyticsConfiguration *tad__SetVideoAnalyticsConfiguration, struct _tad__SetVideoAnalyticsConfigurationResponse *tad__SetVideoAnalyticsConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tad__SetAnalyticsEngineInput(struct soap* soap, struct _tad__SetAnalyticsEngineInput *tad__SetAnalyticsEngineInput, struct _tad__SetAnalyticsEngineInputResponse *tad__SetAnalyticsEngineInputResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tad__GetAnalyticsEngineInput(struct soap* soap, struct _tad__GetAnalyticsEngineInput *tad__GetAnalyticsEngineInput, struct _tad__GetAnalyticsEngineInputResponse *tad__GetAnalyticsEngineInputResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tad__GetAnalyticsEngineInputs(struct soap* soap, struct _tad__GetAnalyticsEngineInputs *tad__GetAnalyticsEngineInputs, struct _tad__GetAnalyticsEngineInputsResponse *tad__GetAnalyticsEngineInputsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tad__GetAnalyticsDeviceStreamUri(struct soap* soap, struct _tad__GetAnalyticsDeviceStreamUri *tad__GetAnalyticsDeviceStreamUri, struct _tad__GetAnalyticsDeviceStreamUriResponse *tad__GetAnalyticsDeviceStreamUriResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tad__GetVideoAnalyticsConfiguration(struct soap* soap, struct _tad__GetVideoAnalyticsConfiguration *tad__GetVideoAnalyticsConfiguration, struct _tad__GetVideoAnalyticsConfigurationResponse *tad__GetVideoAnalyticsConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tad__CreateAnalyticsEngineInputs(struct soap* soap, struct _tad__CreateAnalyticsEngineInputs *tad__CreateAnalyticsEngineInputs, struct _tad__CreateAnalyticsEngineInputsResponse *tad__CreateAnalyticsEngineInputsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tad__DeleteAnalyticsEngineInputs(struct soap* soap, struct _tad__DeleteAnalyticsEngineInputs *tad__DeleteAnalyticsEngineInputs, struct _tad__DeleteAnalyticsEngineInputsResponse *tad__DeleteAnalyticsEngineInputsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tad__GetAnalyticsState(struct soap* soap, struct _tad__GetAnalyticsState *tad__GetAnalyticsState, struct _tad__GetAnalyticsStateResponse *tad__GetAnalyticsStateResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tan__GetSupportedRules(struct soap* soap, struct _tan__GetSupportedRules *tan__GetSupportedRules, struct _tan__GetSupportedRulesResponse *tan__GetSupportedRulesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tan__CreateRules(struct soap* soap, struct _tan__CreateRules *tan__CreateRules, struct _tan__CreateRulesResponse *tan__CreateRulesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tan__DeleteRules(struct soap* soap, struct _tan__DeleteRules *tan__DeleteRules, struct _tan__DeleteRulesResponse *tan__DeleteRulesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tan__GetRules(struct soap* soap, struct _tan__GetRules *tan__GetRules, struct _tan__GetRulesResponse *tan__GetRulesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tan__ModifyRules(struct soap* soap, struct _tan__ModifyRules *tan__ModifyRules, struct _tan__ModifyRulesResponse *tan__ModifyRulesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tan__GetServiceCapabilities(struct soap* soap, struct _tan__GetServiceCapabilities *tan__GetServiceCapabilities, struct _tan__GetServiceCapabilitiesResponse *tan__GetServiceCapabilitiesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tan__GetSupportedAnalyticsModules(struct soap* soap, struct _tan__GetSupportedAnalyticsModules *tan__GetSupportedAnalyticsModules, struct _tan__GetSupportedAnalyticsModulesResponse *tan__GetSupportedAnalyticsModulesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tan__CreateAnalyticsModules(struct soap* soap, struct _tan__CreateAnalyticsModules *tan__CreateAnalyticsModules, struct _tan__CreateAnalyticsModulesResponse *tan__CreateAnalyticsModulesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tan__DeleteAnalyticsModules(struct soap* soap, struct _tan__DeleteAnalyticsModules *tan__DeleteAnalyticsModules, struct _tan__DeleteAnalyticsModulesResponse *tan__DeleteAnalyticsModulesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tan__GetAnalyticsModules(struct soap* soap, struct _tan__GetAnalyticsModules *tan__GetAnalyticsModules, struct _tan__GetAnalyticsModulesResponse *tan__GetAnalyticsModulesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tan__ModifyAnalyticsModules(struct soap* soap, struct _tan__ModifyAnalyticsModules *tan__ModifyAnalyticsModules, struct _tan__ModifyAnalyticsModulesResponse *tan__ModifyAnalyticsModulesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tdn__Hello(struct soap* soap, struct wsdd__HelloType tdn__Hello, struct wsdd__ResolveType *tdn__HelloResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tdn__Bye(struct soap* soap, struct wsdd__ByeType tdn__Bye, struct wsdd__ResolveType *tdn__ByeResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tdn__Probe(struct soap* soap, struct wsdd__ProbeType tdn__Probe, struct wsdd__ProbeMatchesType *tdn__ProbeResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetServices(struct soap* soap, struct _tds__GetServices *tds__GetServices, struct _tds__GetServicesResponse *tds__GetServicesResponse)
{
	//wsr add
	/*该函数很必要*/
    char _IPAddr[INFO_LENGTH];
    int i = 0;
	//unsigned int localIp;
	//netGetIp("eth1", &localIp); //eth0 根据实际情况填充
    //sprintf(_IPAddr, "http://%s/onvif/services",inet_ntoa(*((struct in_addr *)&localIp))/* 192, 168, 1, 233*/);
    sprintf(_IPAddr, "http://%s/onvif/services",onvifConfig.NET.IP);
    tds__GetServicesResponse->__sizeService = 1;

	fprintf(stderr,"%s---%s\n",__FILE__,__func__);

	if(!tds__GetServices->IncludeCapability)
	{
        tds__GetServicesResponse->Service = (struct tds__Service *)soap_malloc(soap, sizeof(struct tds__Service));
	    tds__GetServicesResponse->Service[0].XAddr = (char *)soap_malloc(soap, sizeof(char) * INFO_LENGTH);
	    tds__GetServicesResponse->Service[0].Namespace = (char *)soap_malloc(soap, sizeof(char) * INFO_LENGTH);
	    strcpy(tds__GetServicesResponse->Service[0].Namespace, "http://www.onvif.org/ver10/events/wsdl");
	    strcpy(tds__GetServicesResponse[0].Service->XAddr, _IPAddr);
	    tds__GetServicesResponse->Service[0].Capabilities = NULL;
	    tds__GetServicesResponse->Service[0].Version = (struct tt__OnvifVersion *)soap_malloc(soap, sizeof(struct tt__OnvifVersion));
	    tds__GetServicesResponse->Service[0].Version->Major = 0;
	    tds__GetServicesResponse->Service[0].Version->Minor = 3;
	    tds__GetServicesResponse->Service[0].__any = (char *)soap_malloc(soap, sizeof(char) * INFO_LENGTH);
	    strcpy(tds__GetServicesResponse->Service[0].__any,"why1");
	    tds__GetServicesResponse->Service[0].__size = NULL;
		tds__GetServicesResponse->Service[0].__anyAttribute = NULL;
		return SOAP_OK;
	}
	else
	{
		 tds__GetServicesResponse->Service = (struct tds__Service *)soap_malloc(soap, sizeof(struct tds__Service));
	    tds__GetServicesResponse->Service[0].XAddr = (char *)soap_malloc(soap, sizeof(char) * INFO_LENGTH);
	    tds__GetServicesResponse->Service[0].Namespace = (char *)soap_malloc(soap, sizeof(char) * INFO_LENGTH);
	    strcpy(tds__GetServicesResponse->Service[0].Namespace, "http://www.onvif.org/ver10/events/wsdl");
	    strcpy(tds__GetServicesResponse[0].Service->XAddr, _IPAddr);
	    tds__GetServicesResponse->Service[0].Capabilities = NULL;
	    tds__GetServicesResponse->Service[0].Version = (struct tt__OnvifVersion *)soap_malloc(soap, sizeof(struct tt__OnvifVersion));
	    tds__GetServicesResponse->Service[0].Version->Major = 0;
	    tds__GetServicesResponse->Service[0].Version->Minor = 3;
	    tds__GetServicesResponse->Service[0].__any = NULL;
	    tds__GetServicesResponse->Service[0].__size = NULL;
		tds__GetServicesResponse->Service[0].__anyAttribute = NULL;
		return SOAP_OK;
	}
	//ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetServiceCapabilities(struct soap* soap, struct _tds__GetServiceCapabilities *tds__GetServiceCapabilities, struct _tds__GetServiceCapabilitiesResponse *tds__GetServiceCapabilitiesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetDeviceInformation(struct soap* soap, struct _tds__GetDeviceInformation *tds__GetDeviceInformation, struct _tds__GetDeviceInformationResponse *tds__GetDeviceInformationResponse)
{
	//wsr add
	//char mac[MACH_ADDR_LENGTH];
	//char *_SerialNumber = (char *) malloc(sizeof(char) * LARGE_INFO_LENGTH);


	//net_get_hwaddr(ETH_NAME, mac);
	//sprintf(_SerialNumber,"%02X%02X%02X%02X%02X%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
	//sprintf(_HardwareId,"1419d68a-1dd2-11b2-a105-%02X%02X%02X%02X%02X%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
	tds__GetDeviceInformationResponse->Manufacturer = (char *)soap_malloc(soap, sizeof(char) * LARGE_INFO_LENGTH);
	tds__GetDeviceInformationResponse->Model = (char *)soap_malloc(soap, sizeof(char) * LARGE_INFO_LENGTH);
	tds__GetDeviceInformationResponse->FirmwareVersion = (char *)soap_malloc(soap, sizeof(char) * LARGE_INFO_LENGTH);
	tds__GetDeviceInformationResponse->SerialNumber = (char *)soap_malloc(soap, sizeof(char) * LARGE_INFO_LENGTH);
	tds__GetDeviceInformationResponse->HardwareId = (char *)soap_malloc(soap, sizeof(char) * LARGE_INFO_LENGTH);

	strcpy(tds__GetDeviceInformationResponse->Manufacturer, onvifConfig.DeviceInfo.manufacturer);
	strcpy(tds__GetDeviceInformationResponse->Model, onvifConfig.DeviceInfo.Model);
	strcpy(tds__GetDeviceInformationResponse->FirmwareVersion, onvifConfig.DeviceInfo.Firmware);
	strcpy(tds__GetDeviceInformationResponse->SerialNumber, onvifConfig.NET.Mac);
	strcpy(tds__GetDeviceInformationResponse->HardwareId, onvifConfig.DeviceInfo.DeviceID);

	fprintf(stderr,"%s---%s---%d\n",__FILE__,__func__,__LINE__);
	return SOAP_OK;
	//ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__SetSystemDateAndTime(struct soap* soap, struct _tds__SetSystemDateAndTime *tds__SetSystemDateAndTime, struct _tds__SetSystemDateAndTimeResponse *tds__SetSystemDateAndTimeResponse)
{
	//wsr
	//if(tds__SetSystemDateAndTime->DateTimeType == xsd__boolean__false_)
	{
	//	fprintf(stderr,"%s---%s--\n",__func__,tds__SetSystemDateAndTime->TimeZone->TZ);
		fprintf(stderr,"%s----%d--%d--%d-----%d:%d:%d\n",__func__,tds__SetSystemDateAndTime->UTCDateTime->Date->Year,tds__SetSystemDateAndTime->UTCDateTime->Date->Month,
			tds__SetSystemDateAndTime->UTCDateTime->Date->Day,tds__SetSystemDateAndTime->UTCDateTime->Time->Hour,tds__SetSystemDateAndTime->UTCDateTime->Time->Minute,
			tds__SetSystemDateAndTime->UTCDateTime->Time->Second);
	}
	//else
	{

	}
	return SOAP_OK;
	//ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetSystemDateAndTime(struct soap* soap, struct _tds__GetSystemDateAndTime *tds__GetSystemDateAndTime, struct _tds__GetSystemDateAndTimeResponse *tds__GetSystemDateAndTimeResponse)
{
	//wsr add
	time_t tnow;
	time_t tnow_utc;
	struct tm *tmnow,locTimeSc;
	struct tm *tmnow_utc,locTimeSc_utc;
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime = (struct tt__SystemDateTime *)soap_malloc(soap,sizeof(struct tt__SystemDateTime));
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->Extension = NULL;
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->LocalDateTime = NULL;
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->TimeZone = NULL;
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->UTCDateTime = NULL;
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->__anyAttribute = NULL;
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->DateTimeType = xsd__boolean__false_;
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->DaylightSavings = xsd__boolean__false_;
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->TimeZone = (struct tt__TimeZone*)soap_malloc(soap,sizeof(struct tt__TimeZone));
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->TimeZone->TZ = (char *)soap_malloc(soap,sizeof(char)*100);
	strcpy(tds__GetSystemDateAndTimeResponse->SystemDateAndTime->TimeZone->TZ,"time_Token");
	time(&tnow);
	localtime_r(&tnow, &locTimeSc);
	tmnow = &locTimeSc;
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->LocalDateTime = (struct tt__DateTime*)soap_malloc(soap,sizeof(struct tt__DateTime));
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->LocalDateTime->Time = (struct tt__Time*)soap_malloc(soap,sizeof(struct tt__Time));
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->LocalDateTime->Time->Hour = tmnow->tm_hour;
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->LocalDateTime->Time->Minute = tmnow->tm_min;
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->LocalDateTime->Time->Second = tmnow->tm_sec;
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->LocalDateTime->Date = (struct tt__Date*)soap_malloc(soap,sizeof(struct tt__Date));
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->LocalDateTime->Date->Year = tmnow->tm_year + 1900;
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->LocalDateTime->Date->Month = tmnow->tm_mon + 1;
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->LocalDateTime->Date->Day = tmnow->tm_mday;

	//tnow_utc = tnow - (onvifConfig.NTP.currentTime- 12) * 3600;//current time second 300
	tnow_utc = tnow ;
	localtime_r(&tnow_utc, &locTimeSc_utc);
	tmnow_utc = &locTimeSc_utc;

	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->UTCDateTime = (struct tt__DateTime*)soap_malloc(soap, sizeof(struct tt__DateTime));
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->UTCDateTime->Time = (struct tt__Time*)soap_malloc(soap, sizeof(struct tt__Time));
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->UTCDateTime->Time->Hour = tmnow_utc->tm_hour;
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->UTCDateTime->Time->Minute = tmnow_utc->tm_min;
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->UTCDateTime->Time->Second = tmnow_utc->tm_sec;
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->UTCDateTime->Date = (struct tt__Date*)soap_malloc(soap, sizeof(struct tt__Date));
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->UTCDateTime->Date->Year = tmnow_utc->tm_year + 1900;
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->UTCDateTime->Date->Month = tmnow_utc->tm_mon + 1;
	tds__GetSystemDateAndTimeResponse->SystemDateAndTime->UTCDateTime->Date->Day = tmnow_utc->tm_mday;
	return SOAP_OK;
	//ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__SetSystemFactoryDefault(struct soap* soap, struct _tds__SetSystemFactoryDefault *tds__SetSystemFactoryDefault, struct _tds__SetSystemFactoryDefaultResponse *tds__SetSystemFactoryDefaultResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__UpgradeSystemFirmware(struct soap* soap, struct _tds__UpgradeSystemFirmware *tds__UpgradeSystemFirmware, struct _tds__UpgradeSystemFirmwareResponse *tds__UpgradeSystemFirmwareResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__SystemReboot(struct soap* soap, struct _tds__SystemReboot *tds__SystemReboot, struct _tds__SystemRebootResponse *tds__SystemRebootResponse)
{
	//wsr add
	tds__SystemRebootResponse->Message = "Rebooting";
	//shutdown(0);
	return SOAP_OK;
	//ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__RestoreSystem(struct soap* soap, struct _tds__RestoreSystem *tds__RestoreSystem, struct _tds__RestoreSystemResponse *tds__RestoreSystemResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetSystemBackup(struct soap* soap, struct _tds__GetSystemBackup *tds__GetSystemBackup, struct _tds__GetSystemBackupResponse *tds__GetSystemBackupResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetSystemLog(struct soap* soap, struct _tds__GetSystemLog *tds__GetSystemLog, struct _tds__GetSystemLogResponse *tds__GetSystemLogResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetSystemSupportInformation(struct soap* soap, struct _tds__GetSystemSupportInformation *tds__GetSystemSupportInformation, struct _tds__GetSystemSupportInformationResponse *tds__GetSystemSupportInformationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetScopes(struct soap* soap, struct _tds__GetScopes *tds__GetScopes, struct _tds__GetScopesResponse *tds__GetScopesResponse)
{
	//wsr add
	int i=0;
	int num_scope=0;
	int num_type=0;
	int num_loc=0;
	int _size=0;

	_size = 2;
	tds__GetScopesResponse->__sizeScopes = _size;
	tds__GetScopesResponse->Scopes = (struct tt__Scope*)soap_malloc(soap, (_size *sizeof(struct tt__Scope)));

	tds__GetScopesResponse->Scopes[num_scope].ScopeDef = 0; // Fixed = 0, Configurable = 1
	tds__GetScopesResponse->Scopes[num_scope].ScopeItem = (char *)soap_malloc(soap, (sizeof(char) * INFO_LENGTH));
	strcpy(tds__GetScopesResponse->Scopes[num_scope].ScopeItem, "onvif://www.onvif.org/type/NetworkVideoTransmitter");
	num_scope++;
	tds__GetScopesResponse->Scopes[num_scope].ScopeDef = 0; // Fixed = 0, Configurable = 1
	tds__GetScopesResponse->Scopes[num_scope].ScopeItem = (char *)soap_malloc(soap, (sizeof(char) * INFO_LENGTH));
	strcpy(tds__GetScopesResponse->Scopes[num_scope].ScopeItem, "onvif://www.onvif.org/name/NDC300L-H");
	fprintf(stderr,"%s----%s---%d\n",__FILE__,__func__,__LINE__);
	return SOAP_OK;
	//ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__SetScopes(struct soap* soap, struct _tds__SetScopes *tds__SetScopes, struct _tds__SetScopesResponse *tds__SetScopesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__AddScopes(struct soap* soap, struct _tds__AddScopes *tds__AddScopes, struct _tds__AddScopesResponse *tds__AddScopesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__RemoveScopes(struct soap* soap, struct _tds__RemoveScopes *tds__RemoveScopes, struct _tds__RemoveScopesResponse *tds__RemoveScopesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetDiscoveryMode(struct soap* soap, struct _tds__GetDiscoveryMode *tds__GetDiscoveryMode, struct _tds__GetDiscoveryModeResponse *tds__GetDiscoveryModeResponse)
{
	//wsr add
	tds__GetDiscoveryModeResponse->DiscoveryMode = 0;//0-discoverable,1-discoverable
	return SOAP_OK;
	//ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__SetDiscoveryMode(struct soap* soap, struct _tds__SetDiscoveryMode *tds__SetDiscoveryMode, struct _tds__SetDiscoveryModeResponse *tds__SetDiscoveryModeResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetRemoteDiscoveryMode(struct soap* soap, struct _tds__GetRemoteDiscoveryMode *tds__GetRemoteDiscoveryMode, struct _tds__GetRemoteDiscoveryModeResponse *tds__GetRemoteDiscoveryModeResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__SetRemoteDiscoveryMode(struct soap* soap, struct _tds__SetRemoteDiscoveryMode *tds__SetRemoteDiscoveryMode, struct _tds__SetRemoteDiscoveryModeResponse *tds__SetRemoteDiscoveryModeResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetDPAddresses(struct soap* soap, struct _tds__GetDPAddresses *tds__GetDPAddresses, struct _tds__GetDPAddressesResponse *tds__GetDPAddressesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetEndpointReference(struct soap* soap, struct _tds__GetEndpointReference *tds__GetEndpointReference, struct _tds__GetEndpointReferenceResponse *tds__GetEndpointReferenceResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetRemoteUser(struct soap* soap, struct _tds__GetRemoteUser *tds__GetRemoteUser, struct _tds__GetRemoteUserResponse *tds__GetRemoteUserResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__SetRemoteUser(struct soap* soap, struct _tds__SetRemoteUser *tds__SetRemoteUser, struct _tds__SetRemoteUserResponse *tds__SetRemoteUserResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetUsers(struct soap* soap, struct _tds__GetUsers *tds__GetUsers, struct _tds__GetUsersResponse *tds__GetUsersResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__CreateUsers(struct soap* soap, struct _tds__CreateUsers *tds__CreateUsers, struct _tds__CreateUsersResponse *tds__CreateUsersResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__DeleteUsers(struct soap* soap, struct _tds__DeleteUsers *tds__DeleteUsers, struct _tds__DeleteUsersResponse *tds__DeleteUsersResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__SetUser(struct soap* soap, struct _tds__SetUser *tds__SetUser, struct _tds__SetUserResponse *tds__SetUserResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetWsdlUrl(struct soap* soap, struct _tds__GetWsdlUrl *tds__GetWsdlUrl, struct _tds__GetWsdlUrlResponse *tds__GetWsdlUrlResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetCapabilities(struct soap* soap, struct _tds__GetCapabilities *tds__GetCapabilities, struct _tds__GetCapabilitiesResponse *tds__GetCapabilitiesResponse)
{
	//wsr add
	//想要对接RTSP视频，必须设置Media
	int _Category;
	char _IPv4Address[LARGE_INFO_LENGTH];
	char Media[LARGE_INFO_LENGTH];
	unsigned int localIp;


	if(tds__GetCapabilities->Category == NULL)
	{
		tds__GetCapabilities->Category=(int *)soap_malloc(soap, sizeof(int));
		*tds__GetCapabilities->Category = 0;
		_Category = 0;
	}
	else
	{
		_Category = *tds__GetCapabilities->Category;
	}



	//netGetIp("eth1", &localIp); //eth0 根据实际情况填充
	sprintf(_IPv4Address, "http://%s/onvif/services", onvifConfig.NET.IP);
	sprintf(Media, "http://%s/onvif/services", onvifConfig.NET.IP);
	tds__GetCapabilitiesResponse->Capabilities = (struct tt__Capabilities*)soap_malloc(soap, sizeof(struct tt__Capabilities));

	tds__GetCapabilitiesResponse->Capabilities->Analytics = NULL;
	tds__GetCapabilitiesResponse->Capabilities->Device = NULL;
	tds__GetCapabilitiesResponse->Capabilities->Events = NULL;
	tds__GetCapabilitiesResponse->Capabilities->Imaging = NULL;
	tds__GetCapabilitiesResponse->Capabilities->Media = NULL;
	tds__GetCapabilitiesResponse->Capabilities->PTZ = NULL;
	tds__GetCapabilitiesResponse->Capabilities->__anyAttribute = NULL;

	//下面的重要，这里只实现视频流，需要设置VideoSources
	tds__GetCapabilitiesResponse->Capabilities->Extension = (struct tt__CapabilitiesExtension*)soap_malloc(soap, sizeof(struct tt__CapabilitiesExtension));
	tds__GetCapabilitiesResponse->Capabilities->Extension->DeviceIO = (struct tt__DeviceIOCapabilities*)soap_malloc(soap, sizeof(struct tt__DeviceIOCapabilities));
	tds__GetCapabilitiesResponse->Capabilities->Extension->DeviceIO->XAddr = (char *)soap_malloc(soap, sizeof(char) * INFO_LENGTH);
	strcpy(tds__GetCapabilitiesResponse->Capabilities->Extension->DeviceIO->XAddr,_IPv4Address);
	tds__GetCapabilitiesResponse->Capabilities->Extension->DeviceIO->VideoSources = TRUE;
	tds__GetCapabilitiesResponse->Capabilities->Extension->DeviceIO->VideoOutputs = FALSE;
	tds__GetCapabilitiesResponse->Capabilities->Extension->DeviceIO->AudioSources = FALSE;
	tds__GetCapabilitiesResponse->Capabilities->Extension->DeviceIO->AudioOutputs = FALSE;
	tds__GetCapabilitiesResponse->Capabilities->Extension->DeviceIO->RelayOutputs = FALSE;
	tds__GetCapabilitiesResponse->Capabilities->Extension->DeviceIO->__size = 0;
	tds__GetCapabilitiesResponse->Capabilities->Extension->DeviceIO->__any = NULL;
	tds__GetCapabilitiesResponse->Capabilities->Extension->DeviceIO->__anyAttribute = NULL;
	tds__GetCapabilitiesResponse->Capabilities->Extension->Display = NULL;
	tds__GetCapabilitiesResponse->Capabilities->Extension->Recording = NULL;
	tds__GetCapabilitiesResponse->Capabilities->Extension->Search = NULL;
	tds__GetCapabilitiesResponse->Capabilities->Extension->Replay = NULL;
	tds__GetCapabilitiesResponse->Capabilities->Extension->Receiver = NULL;
	tds__GetCapabilitiesResponse->Capabilities->Extension->AnalyticsDevice = NULL;
	tds__GetCapabilitiesResponse->Capabilities->Extension->Extensions = NULL;
	tds__GetCapabilitiesResponse->Capabilities->Extension->__size = 0;
	tds__GetCapabilitiesResponse->Capabilities->Extension->__any = NULL;

	tds__GetCapabilitiesResponse->Capabilities->Analytics = (struct tt__AnalyticsCapabilities*)soap_malloc(soap, sizeof(struct tt__AnalyticsCapabilities));
	tds__GetCapabilitiesResponse->Capabilities->Analytics->__size = 0;
	tds__GetCapabilitiesResponse->Capabilities->Analytics->__any = NULL;
	tds__GetCapabilitiesResponse->Capabilities->Analytics->__anyAttribute = NULL;
	tds__GetCapabilitiesResponse->Capabilities->Analytics->XAddr = (char *) soap_malloc(soap, sizeof(char) * LARGE_INFO_LENGTH);
	strcpy(tds__GetCapabilitiesResponse->Capabilities->Analytics->XAddr, _IPv4Address);
	tds__GetCapabilitiesResponse->Capabilities->Analytics->RuleSupport = xsd__boolean__false_;
	tds__GetCapabilitiesResponse->Capabilities->Analytics->AnalyticsModuleSupport = xsd__boolean__false_;
	/*基础设置，很必须*/
	tds__GetCapabilitiesResponse->Capabilities->Device = (struct tt__DeviceCapabilities*)soap_malloc(soap, sizeof(struct tt__DeviceCapabilities));
	tds__GetCapabilitiesResponse->Capabilities->Device->__anyAttribute = NULL;
	tds__GetCapabilitiesResponse->Capabilities->Device->XAddr = (char *) soap_malloc(soap, sizeof(char) * LARGE_INFO_LENGTH);
	strcpy(tds__GetCapabilitiesResponse->Capabilities->Device->XAddr, _IPv4Address);
	tds__GetCapabilitiesResponse->Capabilities->Device->Extension = NULL;
	/*必要部分*/
	tds__GetCapabilitiesResponse->Capabilities->Device->Network = (struct tt__NetworkCapabilities*)soap_malloc(soap, sizeof(struct tt__NetworkCapabilities));
	tds__GetCapabilitiesResponse->Capabilities->Device->Network->IPFilter = (int *)soap_malloc(soap, sizeof(int));
	tds__GetCapabilitiesResponse->Capabilities->Device->Network->ZeroConfiguration = (int *)soap_malloc(soap, sizeof(int));
	tds__GetCapabilitiesResponse->Capabilities->Device->Network->IPVersion6 = (int *)soap_malloc(soap, sizeof(int));
	tds__GetCapabilitiesResponse->Capabilities->Device->Network->DynDNS = (int *)soap_malloc(soap, sizeof(int));
	*tds__GetCapabilitiesResponse->Capabilities->Device->Network->IPFilter = xsd__boolean__false_;
	*tds__GetCapabilitiesResponse->Capabilities->Device->Network->ZeroConfiguration = xsd__boolean__false_;
	*tds__GetCapabilitiesResponse->Capabilities->Device->Network->IPVersion6 = xsd__boolean__false_;
	*tds__GetCapabilitiesResponse->Capabilities->Device->Network->DynDNS = xsd__boolean__false_;
	tds__GetCapabilitiesResponse->Capabilities->Device->Network->Extension = (struct tt__NetworkCapabilitiesExtension*)soap_malloc(soap, sizeof(struct tt__NetworkCapabilitiesExtension));
	tds__GetCapabilitiesResponse->Capabilities->Device->Network->Extension->Dot11Configuration = (int *)soap_malloc(soap, sizeof(int));
	*tds__GetCapabilitiesResponse->Capabilities->Device->Network->Extension->Dot11Configuration = xsd__boolean__false_;
	tds__GetCapabilitiesResponse->Capabilities->Device->Network->Extension->Extension = NULL;
	/*ghostyu  MUST BE*/
	tds__GetCapabilitiesResponse->Capabilities->Device->Network->Extension->__size= 0;
	tds__GetCapabilitiesResponse->Capabilities->Device->Network->Extension->__any = NULL;
	tds__GetCapabilitiesResponse->Capabilities->Device->Network->__anyAttribute = NULL;

	tds__GetCapabilitiesResponse->Capabilities->Device->System = NULL;
	tds__GetCapabilitiesResponse->Capabilities->Device->IO = NULL;
	tds__GetCapabilitiesResponse->Capabilities->Device->Security = NULL;
#if 0
	tds__GetCapabilitiesResponse->Capabilities->Device->System = (struct tt__SystemCapabilities*)soap_malloc(soap, sizeof(struct tt__SystemCapabilities));
	tds__GetCapabilitiesResponse->Capabilities->Device->System->DiscoveryResolve = xsd__boolean__false_;
	tds__GetCapabilitiesResponse->Capabilities->Device->System->DiscoveryBye = xsd__boolean__false_;
	tds__GetCapabilitiesResponse->Capabilities->Device->System->RemoteDiscovery = xsd__boolean__false_;
	tds__GetCapabilitiesResponse->Capabilities->Device->System->SystemBackup = xsd__boolean__false_;
	tds__GetCapabilitiesResponse->Capabilities->Device->System->SystemLogging = xsd__boolean__false_;
	tds__GetCapabilitiesResponse->Capabilities->Device->System->FirmwareUpgrade = xsd__boolean__true_;
	tds__GetCapabilitiesResponse->Capabilities->Device->System->__sizeSupportedVersions = xsd__boolean__true_;
	tds__GetCapabilitiesResponse->Capabilities->Device->System->SupportedVersions = (struct tt__OnvifVersion*)soap_malloc(soap, sizeof(struct tt__OnvifVersion));
	tds__GetCapabilitiesResponse->Capabilities->Device->System->SupportedVersions->Major = 1;
	tds__GetCapabilitiesResponse->Capabilities->Device->System->SupportedVersions->Minor = 0;
	tds__GetCapabilitiesResponse->Capabilities->Device->System->Extension = (struct tt__SystemCapabilitiesExtension*)soap_malloc(soap, sizeof(struct tt__SystemCapabilitiesExtension));
	tds__GetCapabilitiesResponse->Capabilities->Device->System->Extension->HttpSystemBackup = (int *)soap_malloc(soap, sizeof(int));
	*tds__GetCapabilitiesResponse->Capabilities->Device->System->Extension->HttpSystemBackup = xsd__boolean__false_;
	tds__GetCapabilitiesResponse->Capabilities->Device->System->Extension->HttpFirmwareUpgrade = (int *)soap_malloc(soap, sizeof(int));
	*tds__GetCapabilitiesResponse->Capabilities->Device->System->Extension->HttpFirmwareUpgrade = xsd__boolean__true_;
	tds__GetCapabilitiesResponse->Capabilities->Device->System->Extension->HttpSystemLogging = (int *)soap_malloc(soap, sizeof(int));
	*tds__GetCapabilitiesResponse->Capabilities->Device->System->Extension->HttpSystemLogging = xsd__boolean__true_;
	tds__GetCapabilitiesResponse->Capabilities->Device->System->Extension->HttpSupportInformation = (int *)soap_malloc(soap, sizeof(int));
	*tds__GetCapabilitiesResponse->Capabilities->Device->System->Extension->HttpSupportInformation = xsd__boolean__true_;
	tds__GetCapabilitiesResponse->Capabilities->Device->System->Extension->Extension = NULL;
	//int _false = 0;
	//int _true = 1;
	tds__GetCapabilitiesResponse->Capabilities->Device->IO = (struct tt__IOCapabilities*)soap_malloc(soap, sizeof(struct tt__IOCapabilities));
	tds__GetCapabilitiesResponse->Capabilities->Device->IO->InputConnectors = &xsd_false;
	tds__GetCapabilitiesResponse->Capabilities->Device->IO->RelayOutputs = &xsd_true;
	tds__GetCapabilitiesResponse->Capabilities->Device->IO->Extension = NULL;
#endif
#if 0
	tds__GetCapabilitiesResponse->Capabilities->Device->Security = (struct tt__SecurityCapabilities*)soap_malloc(soap, sizeof(struct tt__SecurityCapabilities));
	tds__GetCapabilitiesResponse->Capabilities->Device->Security->TLS1_x002e1 = xsd__boolean__false_;
	tds__GetCapabilitiesResponse->Capabilities->Device->Security->TLS1_x002e2 = xsd__boolean__false_;
	tds__GetCapabilitiesResponse->Capabilities->Device->Security->OnboardKeyGeneration = xsd__boolean__false_;
	tds__GetCapabilitiesResponse->Capabilities->Device->Security->AccessPolicyConfig = xsd__boolean__false_;
	tds__GetCapabilitiesResponse->Capabilities->Device->Security->X_x002e509Token = xsd__boolean__false_;
	tds__GetCapabilitiesResponse->Capabilities->Device->Security->SAMLToken = xsd__boolean__false_;
	tds__GetCapabilitiesResponse->Capabilities->Device->Security->KerberosToken = xsd__boolean__false_;
	tds__GetCapabilitiesResponse->Capabilities->Device->Security->RELToken = xsd__boolean__false_;
	tds__GetCapabilitiesResponse->Capabilities->Device->Security->Extension = NULL;
#endif
	tds__GetCapabilitiesResponse->Capabilities->Media = (struct tt__MediaCapabilities*)soap_malloc(soap, sizeof(struct tt__MediaCapabilities));
	tds__GetCapabilitiesResponse->Capabilities->Media->XAddr = (char *) soap_malloc(soap, sizeof(char) * LARGE_INFO_LENGTH);
	strcpy(tds__GetCapabilitiesResponse->Capabilities->Media->XAddr, Media);
	tds__GetCapabilitiesResponse->Capabilities->Media->StreamingCapabilities = (struct tt__RealTimeStreamingCapabilities*)soap_malloc(soap, sizeof(struct tt__RealTimeStreamingCapabilities));
	tds__GetCapabilitiesResponse->Capabilities->Media->StreamingCapabilities->RTPMulticast = (int *)soap_malloc(soap, sizeof(int));
	*tds__GetCapabilitiesResponse->Capabilities->Media->StreamingCapabilities->RTPMulticast = xsd__boolean__false_;
	tds__GetCapabilitiesResponse->Capabilities->Media->StreamingCapabilities->RTP_USCORETCP = (int *)soap_malloc(soap, sizeof(int));
	*tds__GetCapabilitiesResponse->Capabilities->Media->StreamingCapabilities->RTP_USCORETCP = xsd__boolean__true_;
	tds__GetCapabilitiesResponse->Capabilities->Media->StreamingCapabilities->RTP_USCORERTSP_USCORETCP = (int *)soap_malloc(soap, sizeof(int));
	*tds__GetCapabilitiesResponse->Capabilities->Media->StreamingCapabilities->RTP_USCORERTSP_USCORETCP = xsd__boolean__true_;
	tds__GetCapabilitiesResponse->Capabilities->Media->StreamingCapabilities->Extension = NULL;
	tds__GetCapabilitiesResponse->Capabilities->Media->Extension = NULL;
	tds__GetCapabilitiesResponse->Capabilities->Media->__size = 0;
	tds__GetCapabilitiesResponse->Capabilities->Media->__any = NULL;
	tds__GetCapabilitiesResponse->Capabilities->Media->__anyAttribute = NULL;

#if 0
	//Event set
	tds__GetCapabilitiesResponse->Capabilities->Events = (struct tt__EventCapabilities*)soap_malloc(soap, sizeof(struct tt__EventCapabilities));
	tds__GetCapabilitiesResponse->Capabilities->Events->XAddr = (char *) soap_malloc(soap, sizeof(char) * LARGE_INFO_LENGTH);
	strcpy(tds__GetCapabilitiesResponse->Capabilities->Events->XAddr, _IPv4Address);
	tds__GetCapabilitiesResponse->Capabilities->Events->WSSubscriptionPolicySupport = xsd__boolean__false_;
	tds__GetCapabilitiesResponse->Capabilities->Events->WSPullPointSupport = xsd__boolean__false_;
	tds__GetCapabilitiesResponse->Capabilities->Events->WSPausableSubscriptionManagerInterfaceSupport = xsd__boolean__false_;
	//Image set
	tds__GetCapabilitiesResponse->Capabilities->Imaging = (struct tt__ImagingCapabilities*)soap_malloc(soap, sizeof(struct tt__ImagingCapabilities));
	tds__GetCapabilitiesResponse->Capabilities->Imaging->XAddr = (char *) soap_malloc(soap, sizeof(char) * LARGE_INFO_LENGTH);
	strcpy(tds__GetCapabilitiesResponse->Capabilities->Imaging->XAddr, _IPv4Address);


	//PTZ set
	tds__GetCapabilitiesResponse->Capabilities->PTZ = (struct tt__PTZCapabilities*)soap_malloc(soap, sizeof(struct tt__PTZCapabilities));
	tds__GetCapabilitiesResponse->Capabilities->PTZ->XAddr = (char *) soap_malloc(soap, sizeof(char) * LARGE_INFO_LENGTH);
	strcpy(tds__GetCapabilitiesResponse->Capabilities->PTZ->XAddr, _IPv4Address);
	tds__GetCapabilitiesResponse->Capabilities->PTZ->__any = NULL;
	tds__GetCapabilitiesResponse->Capabilities->PTZ->__anyAttribute = NULL;
	tds__GetCapabilitiesResponse->Capabilities->PTZ->__size = 0;
#endif

	fprintf(stderr,"%s---%s---%d\n",__FILE__,__func__,__LINE__);
	return SOAP_OK;
	//ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__SetDPAddresses(struct soap* soap, struct _tds__SetDPAddresses *tds__SetDPAddresses, struct _tds__SetDPAddressesResponse *tds__SetDPAddressesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetHostname(struct soap* soap, struct _tds__GetHostname *tds__GetHostname, struct _tds__GetHostnameResponse *tds__GetHostnameResponse)
{
	//wsr add
	char _HostName[VIDEO_NAME_LEN];
	strcpy(_HostName,onvifConfig.DeviceInfo.hostName);
	tds__GetHostnameResponse->HostnameInformation = (struct tt__HostnameInformation*)soap_malloc(soap,sizeof(struct tt__HostnameInformation));
	tds__GetHostnameResponse->HostnameInformation->__anyAttribute = NULL;
	tds__GetHostnameResponse->HostnameInformation->Name = (char*)soap_malloc(soap,100);
	tds__GetHostnameResponse->HostnameInformation->Extension = (struct tt__HostnameInformationExtension*)soap_malloc(soap,sizeof(struct tt__HostnameInformationExtension ));

	tds__GetHostnameResponse->HostnameInformation->Extension->__size = 0;
	tds__GetHostnameResponse->HostnameInformation->Extension->__any= NULL;
	tds__GetHostnameResponse->HostnameInformation->FromDHCP = 0; //not from DHCP
	strcpy(tds__GetHostnameResponse->HostnameInformation->Name,_HostName);
	fprintf(stderr,"%s---%s---%d\n",__FILE__,__func__,__LINE__);
	return SOAP_OK;
	//ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__SetHostname(struct soap* soap, struct _tds__SetHostname *tds__SetHostname, struct _tds__SetHostnameResponse *tds__SetHostnameResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__SetHostnameFromDHCP(struct soap* soap, struct _tds__SetHostnameFromDHCP *tds__SetHostnameFromDHCP, struct _tds__SetHostnameFromDHCPResponse *tds__SetHostnameFromDHCPResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetDNS(struct soap* soap, struct _tds__GetDNS *tds__GetDNS, struct _tds__GetDNSResponse *tds__GetDNSResponse)
{
	//wsr add
	struct sockaddr_in dns_ip;
	char _dns[LARGE_INFO_LENGTH];
	struct in_addr dns;
	//dns.s_addr = INADDR_ANY;

	//dns_ip.sin_addr.s_addr = dns.s_addr;
	//strcpy(_dns, inet_ntoa(dns_ip.sin_addr));
	strcpy(_dns, onvifConfig.NET.Dns);

	tds__GetDNSResponse->DNSInformation = (struct tt__DNSInformation *)soap_malloc(soap, sizeof(struct tt__DNSInformation));
	tds__GetDNSResponse->DNSInformation->FromDHCP = onvifConfig.DHCP.DhcpFlag;
	tds__GetDNSResponse->DNSInformation->__sizeSearchDomain = 1;
	tds__GetDNSResponse->DNSInformation->SearchDomain = (char **)soap_malloc(soap, sizeof(char *));
	*tds__GetDNSResponse->DNSInformation->SearchDomain = "NDC300L-H";
	tds__GetDNSResponse->DNSInformation->__sizeDNSFromDHCP = 0;
	tds__GetDNSResponse->DNSInformation->__sizeDNSManual = 0;
	tds__GetDNSResponse->DNSInformation->Extension = NULL;
	tds__GetDNSResponse->DNSInformation->DNSFromDHCP = NULL;
	tds__GetDNSResponse->DNSInformation->DNSManual = NULL;
	tds__GetDNSResponse->DNSInformation->__anyAttribute = NULL;

	if((tds__GetDNSResponse->DNSInformation->FromDHCP) == 1)
	{
		tds__GetDNSResponse->DNSInformation->__sizeDNSFromDHCP = 1;
		tds__GetDNSResponse->DNSInformation->DNSFromDHCP = (struct tt__IPAddress *)soap_malloc(soap, sizeof(struct tt__IPAddress));
		tds__GetDNSResponse->DNSInformation->DNSFromDHCP->Type = 0;
		//tds__GetDNSResponse->DNSInformation->DNSFromDHCP->IPv4Address = (char **)soap_malloc(soap, sizeof(char *));
		tds__GetDNSResponse->DNSInformation->DNSFromDHCP->IPv4Address = (char *)soap_malloc(soap, sizeof(char) * LARGE_INFO_LENGTH);
		strcpy(tds__GetDNSResponse->DNSInformation->DNSFromDHCP->IPv4Address, _dns);
		tds__GetDNSResponse->DNSInformation->DNSFromDHCP->IPv6Address = NULL;
	}
	else
	{
		tds__GetDNSResponse->DNSInformation->__sizeDNSManual = 1;
		tds__GetDNSResponse->DNSInformation->DNSManual = ((struct tt__IPAddress *)soap_malloc(soap, sizeof(struct tt__IPAddress)));
		tds__GetDNSResponse->DNSInformation->DNSManual->Type = 0;
		//tds__GetDNSResponse->DNSInformation->DNSManual->IPv4Address = (char **)soap_malloc(soap, sizeof(char *));
		tds__GetDNSResponse->DNSInformation->DNSManual->IPv4Address = (char *)soap_malloc(soap, sizeof(char) * LARGE_INFO_LENGTH);
		strcpy(tds__GetDNSResponse->DNSInformation->DNSManual->IPv4Address, _dns);
		tds__GetDNSResponse->DNSInformation->DNSManual->IPv6Address = NULL;
	}
	fprintf(stderr,"%s----%s---%d\n",__FILE__,__func__,__LINE__);
	return SOAP_OK;
	//ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__SetDNS(struct soap* soap, struct _tds__SetDNS *tds__SetDNS, struct _tds__SetDNSResponse *tds__SetDNSResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetNTP(struct soap* soap, struct _tds__GetNTP *tds__GetNTP, struct _tds__GetNTPResponse *tds__GetNTPResponse)
{
	//wsr add
	char _NTPhostname[MID_INFO_LENGTH];
	struct hostent *host;
	struct in_addr ip;
	char *_IPv4Address;
	char *_NTP = onvifConfig.NTP.ntpServer;
	int dhcp_status = onvifConfig.DHCP.DhcpFlag;
	//ControlSystemData(SFIELD_GET_SNTP_FQDN, (void *)_NTPhostname, sizeof(_NTPhostname));
	/*host = gethostbyname(_NTPhostname);
	if(host != NULL)
	{
		memcpy((char *)&ip, host->h_addr_list[0], sizeof(ip));
		_IPv4Address = inet_ntoa(ip);
	} else {
		_IPv4Address = "140.112.126.36"; //NTP_SERVER_DEFAULT  "tw.pool.ntp.org"
	}*/
	_IPv4Address = onvifConfig.NET.IP;
	tds__GetNTPResponse->NTPInformation = (struct tt__NTPInformation*)soap_malloc(soap, sizeof(struct tt__NTPInformation));
	tds__GetNTPResponse->NTPInformation->FromDHCP = dhcp_status;
	tds__GetNTPResponse->NTPInformation->__sizeNTPFromDHCP = 0;	/* sequence of elements <NTPFromDHCP> */
	tds__GetNTPResponse->NTPInformation->NTPFromDHCP = NULL;	/* optional element of type tt:NetworkHost */
	tds__GetNTPResponse->NTPInformation->__sizeNTPManual = 0;	/* sequence of elements <NTPManual> */
	tds__GetNTPResponse->NTPInformation->NTPManual = NULL;	/* optional element of type tt:NetworkHost */
	tds__GetNTPResponse->NTPInformation->Extension = NULL;	/* optional element of type tt:NTPInformationExtension */
	tds__GetNTPResponse->NTPInformation->__anyAttribute = NULL;
	if(dhcp_status == 1) //FromDHCP
	{
		tds__GetNTPResponse->NTPInformation->__sizeNTPFromDHCP = 1;
		tds__GetNTPResponse->NTPInformation->NTPFromDHCP = (struct tt__NetworkHost*)soap_malloc(soap, sizeof(struct tt__NetworkHost));
		tds__GetNTPResponse->NTPInformation->NTPFromDHCP->Type = 0;
		//tds__GetNTPResponse->NTPInformation->NTPFromDHCP->IPv4Address = (char *)soap_malloc(soap, sizeof(char *));
		tds__GetNTPResponse->NTPInformation->NTPFromDHCP->IPv4Address = (char *)soap_malloc(soap, sizeof(char) * INFO_LENGTH);
		strcpy(tds__GetNTPResponse->NTPInformation->NTPFromDHCP->IPv4Address, _IPv4Address);
		tds__GetNTPResponse->NTPInformation->NTPFromDHCP->IPv6Address = NULL;
		tds__GetNTPResponse->NTPInformation->NTPFromDHCP->DNSname = NULL;
		tds__GetNTPResponse->NTPInformation->NTPFromDHCP->Extension = NULL;
		tds__GetNTPResponse->NTPInformation->NTPFromDHCP->__anyAttribute = NULL;

		tds__GetNTPResponse->NTPInformation->__sizeNTPManual = 0;
		tds__GetNTPResponse->NTPInformation->NTPManual = NULL;

	}
	else // NTPManual || Static
	{
		tds__GetNTPResponse->NTPInformation->__sizeNTPManual = 1;
		tds__GetNTPResponse->NTPInformation->NTPManual = ((struct tt__IPAddress *)soap_malloc(soap, sizeof(struct tt__IPAddress)));
		tds__GetNTPResponse->NTPInformation->NTPManual->Type = 0;
		//tds__GetNTPResponse->NTPInformation->NTPManual->IPv4Address = (char **)soap_malloc(soap, sizeof(char *));
		tds__GetNTPResponse->NTPInformation->NTPManual->IPv4Address = (char *)soap_malloc(soap, sizeof(char) * INFO_LENGTH);
		strcpy(tds__GetNTPResponse->NTPInformation->NTPManual->IPv4Address, _IPv4Address);
		tds__GetNTPResponse->NTPInformation->NTPManual->IPv6Address = NULL;
		tds__GetNTPResponse->NTPInformation->NTPManual->DNSname = NULL;
		tds__GetNTPResponse->NTPInformation->NTPManual->Extension = NULL;
		tds__GetNTPResponse->NTPInformation->NTPManual->__anyAttribute = NULL;

		tds__GetNTPResponse->NTPInformation->__sizeNTPFromDHCP = 0;
		tds__GetNTPResponse->NTPInformation->NTPFromDHCP = NULL;

	}
	return SOAP_OK;
	//ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__SetNTP(struct soap* soap, struct _tds__SetNTP *tds__SetNTP, struct _tds__SetNTPResponse *tds__SetNTPResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetDynamicDNS(struct soap* soap, struct _tds__GetDynamicDNS *tds__GetDynamicDNS, struct _tds__GetDynamicDNSResponse *tds__GetDynamicDNSResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__SetDynamicDNS(struct soap* soap, struct _tds__SetDynamicDNS *tds__SetDynamicDNS, struct _tds__SetDynamicDNSResponse *tds__SetDynamicDNSResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetNetworkInterfaces(struct soap* soap, struct _tds__GetNetworkInterfaces *tds__GetNetworkInterfaces, struct _tds__GetNetworkInterfacesResponse *tds__GetNetworkInterfacesResponse)
{
	//wsr add
	char mac[MACH_ADDR_LENGTH];
	char _mac[LARGE_INFO_LENGTH];
	char _IPAddr[LARGE_INFO_LENGTH];
	char _IPAddr_local[LARGE_INFO_LENGTH];
	//NET_IPV4 ip;
	//NET_IPV4 ip_local;

	//netGetMac("eth1", mac); //eth0  根据实际情况填充
	//mac[0]=0x01;mac[1]=0x01;mac[2]=0x01;mac[3]=0x01;mac[4]=0x01;mac[5]=0x01;
	//ip.int32 = net_get_ifaddr(ETH_NAME);
	//ip_local.int32 = net_get_ifaddr(ETH_NAME_LOCAL);
	//sprintf(_mac, "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
	//sprintf(_IPAddr, "%d.%d.%d.%d", ip.str[0], ip.str[1], ip.str[2], ip.str[3]); //wsr edit 2014.04.26
	//sprintf(_IPAddr_local, "%d.%d.%d.%d", ip_local.str[0], ip_local.str[1], ip_local.str[2], ip_local.str[3]);
	sprintf(_IPAddr, "%s", onvifConfig.NET.IP);
	sprintf(_IPAddr_local, "%s", "127.0.0.1");
	sprintf(_mac, "%s",onvifConfig.NET.Mac);

	fprintf(stderr,"%s----MAC=%s==IPADDR=%s===IPADDR_LOCAL=%s\n",__func__,_mac,_IPAddr,_IPAddr_local);
	tds__GetNetworkInterfacesResponse->__sizeNetworkInterfaces = 1;
	tds__GetNetworkInterfacesResponse->NetworkInterfaces = (struct tt__NetworkInterface *)soap_malloc(soap, sizeof(struct tt__NetworkInterface));
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->Extension = NULL;
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->Info = NULL;
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->IPv4 = NULL;
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->IPv6 = NULL;
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->Link = NULL;
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->__anyAttribute = NULL;
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->token = (char *)soap_malloc(soap, 100);
	strcpy(tds__GetNetworkInterfacesResponse->NetworkInterfaces->token,ETH_NAME);
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->Enabled = xsd__boolean__true_;

	tds__GetNetworkInterfacesResponse->NetworkInterfaces->Info = (struct tt__NetworkInterfaceInfo *)soap_malloc(soap, sizeof(struct tt__NetworkInterfaceInfo));
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->Info->Name = (char *)soap_malloc(soap, 100);
	strcpy(tds__GetNetworkInterfacesResponse->NetworkInterfaces->Info->Name,ETH_NAME);
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->Info->HwAddress = (char *)soap_malloc(soap, LARGE_INFO_LENGTH);
	strcpy(tds__GetNetworkInterfacesResponse->NetworkInterfaces->Info->HwAddress,_mac);
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->Info->MTU = (int *)soap_malloc(soap, sizeof(int));
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->Info->MTU[0] = 1500;

	tds__GetNetworkInterfacesResponse->NetworkInterfaces->Link = NULL;
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->IPv4 = (struct tt__IPv4NetworkInterface *)soap_malloc(soap, sizeof(struct tt__IPv4NetworkInterface));
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->IPv4->Enabled = xsd__boolean__true_;
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->IPv4->Config = (struct tt__IPv4Configuration *)soap_malloc(soap, sizeof(struct tt__IPv4Configuration));
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->IPv4->Config->FromDHCP = NULL;
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->IPv4->Config->LinkLocal = NULL;
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->IPv4->Config->Manual = NULL;
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->IPv4->Config->__any = NULL;
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->IPv4->Config->__size = 0;
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->IPv4->Config->__anyAttribute = NULL;
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->IPv4->Config->__sizeManual = 1;
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->IPv4->Config->Manual = (struct tt__PrefixedIPv4Address *)soap_malloc(soap, sizeof(struct tt__PrefixedIPv4Address));
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->IPv4->Config->Manual->Address = (char *)soap_malloc(soap, sizeof(char) * MID_INFO_LENGTH);
	strcpy(tds__GetNetworkInterfacesResponse->NetworkInterfaces->IPv4->Config->Manual->Address,_IPAddr);

	tds__GetNetworkInterfacesResponse->NetworkInterfaces->IPv4->Config->LinkLocal = (struct tt__PrefixedIPv4Address *)soap_malloc(soap, sizeof(struct tt__PrefixedIPv4Address));
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->IPv4->Config->LinkLocal->Address =(char *)soap_malloc(soap, LARGE_INFO_LENGTH);
	strcpy(tds__GetNetworkInterfacesResponse->NetworkInterfaces->IPv4->Config->LinkLocal->Address, _IPAddr_local);
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->IPv4->Config->FromDHCP = (struct tt__PrefixedIPv4Address *)soap_malloc(soap, sizeof(struct tt__PrefixedIPv4Address));
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->IPv4->Config->FromDHCP->Address = (char *)soap_malloc(soap, LARGE_INFO_LENGTH);
	strcpy(tds__GetNetworkInterfacesResponse->NetworkInterfaces->IPv4->Config->FromDHCP->Address, _IPAddr);
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->IPv4->Config->FromDHCP->PrefixLength = 24;
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->IPv4->Config->DHCP = xsd__boolean__false_;
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->IPv6 = NULL;
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->Extension = NULL;
	tds__GetNetworkInterfacesResponse->NetworkInterfaces->__anyAttribute = NULL;
	fprintf(stderr,"%s---%s--%d\n",__FILE__,__func__,__LINE__);
	return SOAP_OK;
	//ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__SetNetworkInterfaces(struct soap* soap, struct _tds__SetNetworkInterfaces *tds__SetNetworkInterfaces, struct _tds__SetNetworkInterfacesResponse *tds__SetNetworkInterfacesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetNetworkProtocols(struct soap* soap, struct _tds__GetNetworkProtocols *tds__GetNetworkProtocols, struct _tds__GetNetworkProtocolsResponse *tds__GetNetworkProtocolsResponse)
{
	//wsr add 2014.04.28
	/*int _http_port = 80;
	int _https_port = 81;
	int _h2641_port = 8556;
	int _h2642_port = 8557;
	int _mpeg41_port = 8553;
	int _mpeg42_port = 8554;
	int _mjpeg_port = 8555;*/

	tds__GetNetworkProtocolsResponse->__sizeNetworkProtocols = 2;
	tds__GetNetworkProtocolsResponse->NetworkProtocols = (struct tt__NetworkProtocol *)soap_malloc(soap,tds__GetNetworkProtocolsResponse->__sizeNetworkProtocols * sizeof(struct tt__NetworkProtocol));

	tds__GetNetworkProtocolsResponse->NetworkProtocols[0].Name = 0;	// HTTP = 0, HTTPS = 1, RTSP = 2
	tds__GetNetworkProtocolsResponse->NetworkProtocols[0].Enabled = 1;
	tds__GetNetworkProtocolsResponse->NetworkProtocols[0].__sizePort = 1;
	tds__GetNetworkProtocolsResponse->NetworkProtocols[0].Port = (int *)soap_malloc(soap, sizeof(int));
	*tds__GetNetworkProtocolsResponse->NetworkProtocols[0].Port = onvifConfig.NetProtoPort.httpPort;
	tds__GetNetworkProtocolsResponse->NetworkProtocols[0].Extension = NULL;
	tds__GetNetworkProtocolsResponse->NetworkProtocols[0].__anyAttribute = NULL;

	tds__GetNetworkProtocolsResponse->NetworkProtocols[1].Name = 2;
	tds__GetNetworkProtocolsResponse->NetworkProtocols[1].Enabled = 1;
	tds__GetNetworkProtocolsResponse->NetworkProtocols[1].__sizePort = 4;
	tds__GetNetworkProtocolsResponse->NetworkProtocols[1].Port = (int *)soap_malloc(soap, tds__GetNetworkProtocolsResponse->NetworkProtocols[1].__sizePort * sizeof(int));
	tds__GetNetworkProtocolsResponse->NetworkProtocols[1].Port[0] = onvifConfig.NetProtoPort.rtspPort1;
	tds__GetNetworkProtocolsResponse->NetworkProtocols[1].Port[1] = onvifConfig.NetProtoPort.rtspPort2;
	tds__GetNetworkProtocolsResponse->NetworkProtocols[1].Port[2] = onvifConfig.NetProtoPort.rtspPort3;
	tds__GetNetworkProtocolsResponse->NetworkProtocols[1].Port[3] = onvifConfig.NetProtoPort.rtspPort4;
	tds__GetNetworkProtocolsResponse->NetworkProtocols[1].Extension = NULL;
	tds__GetNetworkProtocolsResponse->NetworkProtocols[1].__anyAttribute = NULL;
	return SOAP_OK;
	//ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__SetNetworkProtocols(struct soap* soap, struct _tds__SetNetworkProtocols *tds__SetNetworkProtocols, struct _tds__SetNetworkProtocolsResponse *tds__SetNetworkProtocolsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetNetworkDefaultGateway(struct soap* soap, struct _tds__GetNetworkDefaultGateway *tds__GetNetworkDefaultGateway, struct _tds__GetNetworkDefaultGatewayResponse *tds__GetNetworkDefaultGatewayResponse)
{
	//wsr add
	struct sockaddr_in gateway_ip;
	char _GatewayAddress[LARGE_INFO_LENGTH];
	//gateway_ip.sin_addr.s_addr = oSysInfo->lan_config.net.gateway.s_addr;
	//strcpy(_GatewayAddress, inet_ntoa(gateway_ip.sin_addr));
	strcpy(_GatewayAddress, onvifConfig.NET.GateWay);
	tds__GetNetworkDefaultGatewayResponse->NetworkGateway = ((struct tt__NetworkGateway *)soap_malloc(soap,sizeof(struct tt__NetworkGateway*)));
	tds__GetNetworkDefaultGatewayResponse->NetworkGateway->__sizeIPv4Address = 1;
	tds__GetNetworkDefaultGatewayResponse->NetworkGateway->__sizeIPv6Address = 0;
	tds__GetNetworkDefaultGatewayResponse->NetworkGateway->IPv4Address = (char **)soap_malloc(soap, sizeof(char *));
	tds__GetNetworkDefaultGatewayResponse->NetworkGateway->IPv4Address[0] = (char *)soap_malloc(soap, INFO_LENGTH);
	strcpy(*tds__GetNetworkDefaultGatewayResponse->NetworkGateway->IPv4Address, _GatewayAddress);
	tds__GetNetworkDefaultGatewayResponse->NetworkGateway->IPv6Address = NULL;
	return SOAP_OK;
	//ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__SetNetworkDefaultGateway(struct soap* soap, struct _tds__SetNetworkDefaultGateway *tds__SetNetworkDefaultGateway, struct _tds__SetNetworkDefaultGatewayResponse *tds__SetNetworkDefaultGatewayResponse)
{
	//wsr add
	struct in_addr ipaddr;
	char _IPv4Address[LARGE_INFO_LENGTH];
	if(tds__SetNetworkDefaultGateway->__sizeIPv6Address)
	{
		onvif_fault(soap,"ter:NotSupported", "ter:InvalidIPv6Address");
		return SOAP_FAULT;
	}
	if(!tds__SetNetworkDefaultGateway->__sizeIPv4Address)
	{
		onvif_fault(soap,"ter:InvalidArgVal", "ter:InvalidGatewayAddress");
		return SOAP_FAULT;
	}
	strcpy(_IPv4Address, *tds__SetNetworkDefaultGateway->IPv4Address);
	if(isValidIp4(_IPv4Address) == 0) // Check IP address
	{
		onvif_fault(soap,"ter:InvalidArgVal", "ter:InvalidGatewayAddress");
		return SOAP_FAULT;
	}
	//ipv4_str_to_num(_IPv4Address, &ipaddr);
	//ControlSystemData(SFIELD_SET_GATEWAY, (void *)&ipaddr.s_addr, sizeof(ipaddr.s_addr));
	return SOAP_OK;
	//ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetZeroConfiguration(struct soap* soap, struct _tds__GetZeroConfiguration *tds__GetZeroConfiguration, struct _tds__GetZeroConfigurationResponse *tds__GetZeroConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__SetZeroConfiguration(struct soap* soap, struct _tds__SetZeroConfiguration *tds__SetZeroConfiguration, struct _tds__SetZeroConfigurationResponse *tds__SetZeroConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetIPAddressFilter(struct soap* soap, struct _tds__GetIPAddressFilter *tds__GetIPAddressFilter, struct _tds__GetIPAddressFilterResponse *tds__GetIPAddressFilterResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__SetIPAddressFilter(struct soap* soap, struct _tds__SetIPAddressFilter *tds__SetIPAddressFilter, struct _tds__SetIPAddressFilterResponse *tds__SetIPAddressFilterResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__AddIPAddressFilter(struct soap* soap, struct _tds__AddIPAddressFilter *tds__AddIPAddressFilter, struct _tds__AddIPAddressFilterResponse *tds__AddIPAddressFilterResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__RemoveIPAddressFilter(struct soap* soap, struct _tds__RemoveIPAddressFilter *tds__RemoveIPAddressFilter, struct _tds__RemoveIPAddressFilterResponse *tds__RemoveIPAddressFilterResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetAccessPolicy(struct soap* soap, struct _tds__GetAccessPolicy *tds__GetAccessPolicy, struct _tds__GetAccessPolicyResponse *tds__GetAccessPolicyResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__SetAccessPolicy(struct soap* soap, struct _tds__SetAccessPolicy *tds__SetAccessPolicy, struct _tds__SetAccessPolicyResponse *tds__SetAccessPolicyResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__CreateCertificate(struct soap* soap, struct _tds__CreateCertificate *tds__CreateCertificate, struct _tds__CreateCertificateResponse *tds__CreateCertificateResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetCertificates(struct soap* soap, struct _tds__GetCertificates *tds__GetCertificates, struct _tds__GetCertificatesResponse *tds__GetCertificatesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetCertificatesStatus(struct soap* soap, struct _tds__GetCertificatesStatus *tds__GetCertificatesStatus, struct _tds__GetCertificatesStatusResponse *tds__GetCertificatesStatusResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__SetCertificatesStatus(struct soap* soap, struct _tds__SetCertificatesStatus *tds__SetCertificatesStatus, struct _tds__SetCertificatesStatusResponse *tds__SetCertificatesStatusResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__DeleteCertificates(struct soap* soap, struct _tds__DeleteCertificates *tds__DeleteCertificates, struct _tds__DeleteCertificatesResponse *tds__DeleteCertificatesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetPkcs10Request(struct soap* soap, struct _tds__GetPkcs10Request *tds__GetPkcs10Request, struct _tds__GetPkcs10RequestResponse *tds__GetPkcs10RequestResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__LoadCertificates(struct soap* soap, struct _tds__LoadCertificates *tds__LoadCertificates, struct _tds__LoadCertificatesResponse *tds__LoadCertificatesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetClientCertificateMode(struct soap* soap, struct _tds__GetClientCertificateMode *tds__GetClientCertificateMode, struct _tds__GetClientCertificateModeResponse *tds__GetClientCertificateModeResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__SetClientCertificateMode(struct soap* soap, struct _tds__SetClientCertificateMode *tds__SetClientCertificateMode, struct _tds__SetClientCertificateModeResponse *tds__SetClientCertificateModeResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetRelayOutputs(struct soap* soap, struct _tds__GetRelayOutputs *tds__GetRelayOutputs, struct _tds__GetRelayOutputsResponse *tds__GetRelayOutputsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__SetRelayOutputSettings(struct soap* soap, struct _tds__SetRelayOutputSettings *tds__SetRelayOutputSettings, struct _tds__SetRelayOutputSettingsResponse *tds__SetRelayOutputSettingsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__SetRelayOutputState(struct soap* soap, struct _tds__SetRelayOutputState *tds__SetRelayOutputState, struct _tds__SetRelayOutputStateResponse *tds__SetRelayOutputStateResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__SendAuxiliaryCommand(struct soap* soap, struct _tds__SendAuxiliaryCommand *tds__SendAuxiliaryCommand, struct _tds__SendAuxiliaryCommandResponse *tds__SendAuxiliaryCommandResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetCACertificates(struct soap* soap, struct _tds__GetCACertificates *tds__GetCACertificates, struct _tds__GetCACertificatesResponse *tds__GetCACertificatesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__LoadCertificateWithPrivateKey(struct soap* soap, struct _tds__LoadCertificateWithPrivateKey *tds__LoadCertificateWithPrivateKey, struct _tds__LoadCertificateWithPrivateKeyResponse *tds__LoadCertificateWithPrivateKeyResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetCertificateInformation(struct soap* soap, struct _tds__GetCertificateInformation *tds__GetCertificateInformation, struct _tds__GetCertificateInformationResponse *tds__GetCertificateInformationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__LoadCACertificates(struct soap* soap, struct _tds__LoadCACertificates *tds__LoadCACertificates, struct _tds__LoadCACertificatesResponse *tds__LoadCACertificatesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__CreateDot1XConfiguration(struct soap* soap, struct _tds__CreateDot1XConfiguration *tds__CreateDot1XConfiguration, struct _tds__CreateDot1XConfigurationResponse *tds__CreateDot1XConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__SetDot1XConfiguration(struct soap* soap, struct _tds__SetDot1XConfiguration *tds__SetDot1XConfiguration, struct _tds__SetDot1XConfigurationResponse *tds__SetDot1XConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetDot1XConfiguration(struct soap* soap, struct _tds__GetDot1XConfiguration *tds__GetDot1XConfiguration, struct _tds__GetDot1XConfigurationResponse *tds__GetDot1XConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetDot1XConfigurations(struct soap* soap, struct _tds__GetDot1XConfigurations *tds__GetDot1XConfigurations, struct _tds__GetDot1XConfigurationsResponse *tds__GetDot1XConfigurationsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__DeleteDot1XConfiguration(struct soap* soap, struct _tds__DeleteDot1XConfiguration *tds__DeleteDot1XConfiguration, struct _tds__DeleteDot1XConfigurationResponse *tds__DeleteDot1XConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetDot11Capabilities(struct soap* soap, struct _tds__GetDot11Capabilities *tds__GetDot11Capabilities, struct _tds__GetDot11CapabilitiesResponse *tds__GetDot11CapabilitiesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetDot11Status(struct soap* soap, struct _tds__GetDot11Status *tds__GetDot11Status, struct _tds__GetDot11StatusResponse *tds__GetDot11StatusResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__ScanAvailableDot11Networks(struct soap* soap, struct _tds__ScanAvailableDot11Networks *tds__ScanAvailableDot11Networks, struct _tds__ScanAvailableDot11NetworksResponse *tds__ScanAvailableDot11NetworksResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__GetSystemUris(struct soap* soap, struct _tds__GetSystemUris *tds__GetSystemUris, struct _tds__GetSystemUrisResponse *tds__GetSystemUrisResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__StartFirmwareUpgrade(struct soap* soap, struct _tds__StartFirmwareUpgrade *tds__StartFirmwareUpgrade, struct _tds__StartFirmwareUpgradeResponse *tds__StartFirmwareUpgradeResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tds__StartSystemRestore(struct soap* soap, struct _tds__StartSystemRestore *tds__StartSystemRestore, struct _tds__StartSystemRestoreResponse *tds__StartSystemRestoreResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tev__PullMessages(struct soap* soap, struct _tev__PullMessages *tev__PullMessages, struct _tev__PullMessagesResponse *tev__PullMessagesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tev__SetSynchronizationPoint(struct soap* soap, struct _tev__SetSynchronizationPoint *tev__SetSynchronizationPoint, struct _tev__SetSynchronizationPointResponse *tev__SetSynchronizationPointResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tev__GetServiceCapabilities(struct soap* soap, struct _tev__GetServiceCapabilities *tev__GetServiceCapabilities, struct _tev__GetServiceCapabilitiesResponse *tev__GetServiceCapabilitiesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tev__CreatePullPointSubscription(struct soap* soap, struct _tev__CreatePullPointSubscription *tev__CreatePullPointSubscription, struct _tev__CreatePullPointSubscriptionResponse *tev__CreatePullPointSubscriptionResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tev__GetEventProperties(struct soap* soap, struct _tev__GetEventProperties *tev__GetEventProperties, struct _tev__GetEventPropertiesResponse *tev__GetEventPropertiesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tev__Renew(struct soap* soap, struct _wsnt__Renew *wsnt__Renew, struct _wsnt__RenewResponse *wsnt__RenewResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tev__Unsubscribe(struct soap* soap, struct _wsnt__Unsubscribe *wsnt__Unsubscribe, struct _wsnt__UnsubscribeResponse *wsnt__UnsubscribeResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tev__Subscribe(struct soap* soap, struct _wsnt__Subscribe *wsnt__Subscribe, struct _wsnt__SubscribeResponse *wsnt__SubscribeResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tev__GetCurrentMessage(struct soap* soap, struct _wsnt__GetCurrentMessage *wsnt__GetCurrentMessage, struct _wsnt__GetCurrentMessageResponse *wsnt__GetCurrentMessageResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tev__Notify(struct soap* soap, struct _wsnt__Notify *wsnt__Notify)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tev__GetMessages(struct soap* soap, struct _wsnt__GetMessages *wsnt__GetMessages, struct _wsnt__GetMessagesResponse *wsnt__GetMessagesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tev__DestroyPullPoint(struct soap* soap, struct _wsnt__DestroyPullPoint *wsnt__DestroyPullPoint, struct _wsnt__DestroyPullPointResponse *wsnt__DestroyPullPointResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tev__Notify_(struct soap* soap, struct _wsnt__Notify *wsnt__Notify)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tev__CreatePullPoint(struct soap* soap, struct _wsnt__CreatePullPoint *wsnt__CreatePullPoint, struct _wsnt__CreatePullPointResponse *wsnt__CreatePullPointResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tev__Renew_(struct soap* soap, struct _wsnt__Renew *wsnt__Renew, struct _wsnt__RenewResponse *wsnt__RenewResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tev__Unsubscribe_(struct soap* soap, struct _wsnt__Unsubscribe *wsnt__Unsubscribe, struct _wsnt__UnsubscribeResponse *wsnt__UnsubscribeResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tev__PauseSubscription(struct soap* soap, struct _wsnt__PauseSubscription *wsnt__PauseSubscription, struct _wsnt__PauseSubscriptionResponse *wsnt__PauseSubscriptionResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tev__ResumeSubscription(struct soap* soap, struct _wsnt__ResumeSubscription *wsnt__ResumeSubscription, struct _wsnt__ResumeSubscriptionResponse *wsnt__ResumeSubscriptionResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __timg__GetServiceCapabilities(struct soap* soap, struct _timg__GetServiceCapabilities *timg__GetServiceCapabilities, struct _timg__GetServiceCapabilitiesResponse *timg__GetServiceCapabilitiesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __timg__GetImagingSettings(struct soap* soap, struct _timg__GetImagingSettings *timg__GetImagingSettings, struct _timg__GetImagingSettingsResponse *timg__GetImagingSettingsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __timg__SetImagingSettings(struct soap* soap, struct _timg__SetImagingSettings *timg__SetImagingSettings, struct _timg__SetImagingSettingsResponse *timg__SetImagingSettingsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __timg__GetOptions(struct soap* soap, struct _timg__GetOptions *timg__GetOptions, struct _timg__GetOptionsResponse *timg__GetOptionsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __timg__Move(struct soap* soap, struct _timg__Move *timg__Move, struct _timg__MoveResponse *timg__MoveResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __timg__Stop(struct soap* soap, struct _timg__Stop *timg__Stop, struct _timg__StopResponse *timg__StopResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __timg__GetStatus(struct soap* soap, struct _timg__GetStatus *timg__GetStatus, struct _timg__GetStatusResponse *timg__GetStatusResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __timg__GetMoveOptions(struct soap* soap, struct _timg__GetMoveOptions *timg__GetMoveOptions, struct _timg__GetMoveOptionsResponse *timg__GetMoveOptionsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tls__GetServiceCapabilities(struct soap* soap, struct _tls__GetServiceCapabilities *tls__GetServiceCapabilities, struct _tls__GetServiceCapabilitiesResponse *tls__GetServiceCapabilitiesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tls__GetLayout(struct soap* soap, struct _tls__GetLayout *tls__GetLayout, struct _tls__GetLayoutResponse *tls__GetLayoutResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tls__SetLayout(struct soap* soap, struct _tls__SetLayout *tls__SetLayout, struct _tls__SetLayoutResponse *tls__SetLayoutResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tls__GetDisplayOptions(struct soap* soap, struct _tls__GetDisplayOptions *tls__GetDisplayOptions, struct _tls__GetDisplayOptionsResponse *tls__GetDisplayOptionsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tls__GetPaneConfigurations(struct soap* soap, struct _tls__GetPaneConfigurations *tls__GetPaneConfigurations, struct _tls__GetPaneConfigurationsResponse *tls__GetPaneConfigurationsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tls__GetPaneConfiguration(struct soap* soap, struct _tls__GetPaneConfiguration *tls__GetPaneConfiguration, struct _tls__GetPaneConfigurationResponse *tls__GetPaneConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tls__SetPaneConfigurations(struct soap* soap, struct _tls__SetPaneConfigurations *tls__SetPaneConfigurations, struct _tls__SetPaneConfigurationsResponse *tls__SetPaneConfigurationsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tls__SetPaneConfiguration(struct soap* soap, struct _tls__SetPaneConfiguration *tls__SetPaneConfiguration, struct _tls__SetPaneConfigurationResponse *tls__SetPaneConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tls__CreatePaneConfiguration(struct soap* soap, struct _tls__CreatePaneConfiguration *tls__CreatePaneConfiguration, struct _tls__CreatePaneConfigurationResponse *tls__CreatePaneConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tls__DeletePaneConfiguration(struct soap* soap, struct _tls__DeletePaneConfiguration *tls__DeletePaneConfiguration, struct _tls__DeletePaneConfigurationResponse *tls__DeletePaneConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tmd__GetServiceCapabilities(struct soap* soap, struct _tmd__GetServiceCapabilities *tmd__GetServiceCapabilities, struct _tmd__GetServiceCapabilitiesResponse *tmd__GetServiceCapabilitiesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tmd__GetAudioSources(struct soap* soap, struct _trt__GetAudioSources *trt__GetAudioSources, struct _trt__GetAudioSourcesResponse *trt__GetAudioSourcesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tmd__GetAudioOutputs(struct soap* soap, struct _trt__GetAudioOutputs *trt__GetAudioOutputs, struct _trt__GetAudioOutputsResponse *trt__GetAudioOutputsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tmd__GetVideoSources(struct soap* soap, struct _trt__GetVideoSources *trt__GetVideoSources, struct _trt__GetVideoSourcesResponse *trt__GetVideoSourcesResponse)
{
	//wsr add
	int size1;
	int i;
    size1 = onvifConfig.nProfile;
    trt__GetVideoSourcesResponse->__sizeVideoSources = size1;
    trt__GetVideoSourcesResponse->VideoSources = (struct tt__VideoSource *)soap_malloc(soap, sizeof(struct tt__VideoSource) * size1);
	for(i = 0; i < size1; i++)
	{
		trt__GetVideoSourcesResponse->VideoSources[i].token = NULL;	/* required attribute of type tt:ReferenceToken */
		trt__GetVideoSourcesResponse->VideoSources[i].Resolution = NULL;	/* required element of type tt:VideoResolution */
		trt__GetVideoSourcesResponse->VideoSources[i].Imaging = NULL;	/* optional element of type tt:ImagingSettings */
		trt__GetVideoSourcesResponse->VideoSources[i].Extension = NULL;	/* optional element of type tt:VideoSourceExtension */
		trt__GetVideoSourcesResponse->VideoSources[i].__anyAttribute = NULL;
	    trt__GetVideoSourcesResponse->VideoSources[i].Framerate = 30;
	    trt__GetVideoSourcesResponse->VideoSources[i].Resolution = (struct tt__VideoResolution *)soap_malloc(soap, sizeof(struct tt__VideoResolution));
	    trt__GetVideoSourcesResponse->VideoSources[i].Resolution->Height = onvifConfig.Profile[i].VSCD.windowHeight;  //wsr edit
	    trt__GetVideoSourcesResponse->VideoSources[i].Resolution->Width = onvifConfig.Profile[i].VSCD.windowWidth;  //wsr edit
	    trt__GetVideoSourcesResponse->VideoSources[i].token = (char *)soap_malloc(soap, sizeof(char)*INFO_LENGTH);
	    strcpy(trt__GetVideoSourcesResponse->VideoSources[i].token,onvifConfig.Profile[i].VSCD.VsourceToken);

	    trt__GetVideoSourcesResponse->VideoSources[i].Imaging =(struct tt__ImagingSettings*)soap_malloc(soap, sizeof(struct tt__ImagingSettings));
		trt__GetVideoSourcesResponse->VideoSources[i].Imaging->__anyAttribute = NULL;
	    trt__GetVideoSourcesResponse->VideoSources[i].Imaging->Brightness = (float*)soap_malloc(soap,sizeof(float));
	    *trt__GetVideoSourcesResponse->VideoSources[i].Imaging->Brightness = onvifConfig.Image.Brightness;
	    trt__GetVideoSourcesResponse->VideoSources[i].Imaging->ColorSaturation = (float*)soap_malloc(soap,sizeof(float));
	    *trt__GetVideoSourcesResponse->VideoSources[i].Imaging->ColorSaturation = onvifConfig.Image.ColorSaturation;
	    trt__GetVideoSourcesResponse->VideoSources[i].Imaging->Contrast = (float*)soap_malloc(soap,sizeof(float));
	    *trt__GetVideoSourcesResponse->VideoSources[i].Imaging->Contrast = onvifConfig.Image.Contrast;
	    trt__GetVideoSourcesResponse->VideoSources[i].Imaging->IrCutFilter = (int *)soap_malloc(soap,sizeof(int));
	    *trt__GetVideoSourcesResponse->VideoSources[i].Imaging->IrCutFilter = 0;
	    trt__GetVideoSourcesResponse->VideoSources[i].Imaging->Sharpness = (float*)soap_malloc(soap,sizeof(float));
	    *trt__GetVideoSourcesResponse->VideoSources[i].Imaging->Sharpness = onvifConfig.Image.Sharpness;
	    trt__GetVideoSourcesResponse->VideoSources[i].Imaging->BacklightCompensation = (struct tt__BacklightCompensation*)soap_malloc(soap, sizeof(struct tt__BacklightCompensation));
	    trt__GetVideoSourcesResponse->VideoSources[i].Imaging->BacklightCompensation->Mode = onvifConfig.Image.BacklightCompenSationMod;
	    trt__GetVideoSourcesResponse->VideoSources[i].Imaging->BacklightCompensation->Level = onvifConfig.Image.BackLightLevel;
	    trt__GetVideoSourcesResponse->VideoSources[i].Imaging->Exposure = NULL;
	    trt__GetVideoSourcesResponse->VideoSources[i].Imaging->Focus = NULL;
	    trt__GetVideoSourcesResponse->VideoSources[i].Imaging->WideDynamicRange = (struct tt__WideDynamicRange*)soap_malloc(soap, sizeof(struct tt__WideDynamicRange));
	    trt__GetVideoSourcesResponse->VideoSources[i].Imaging->WideDynamicRange->Mode = onvifConfig.Image.WideDynamicMode;
	    trt__GetVideoSourcesResponse->VideoSources[i].Imaging->WideDynamicRange->Level = onvifConfig.Image.BackLightLevel;
	    trt__GetVideoSourcesResponse->VideoSources[i].Imaging->WhiteBalance = (struct tt__WhiteBalance*)soap_malloc(soap, sizeof(struct tt__WhiteBalance));
		trt__GetVideoSourcesResponse->VideoSources[i].Imaging->WhiteBalance->__size = 0;	/* sequence of elements <-any> */
		trt__GetVideoSourcesResponse->VideoSources[i].Imaging->WhiteBalance->__any = NULL;
		trt__GetVideoSourcesResponse->VideoSources[i].Imaging->WhiteBalance->__anyAttribute = NULL;
		trt__GetVideoSourcesResponse->VideoSources[i].Imaging->WhiteBalance->Mode = onvifConfig.Image.WhiteBalanceMode;
	    trt__GetVideoSourcesResponse->VideoSources[i].Imaging->WhiteBalance->CrGain = onvifConfig.Image.CrGain;
	    trt__GetVideoSourcesResponse->VideoSources[i].Imaging->WhiteBalance->CbGain = onvifConfig.Image.CbGain;
	    trt__GetVideoSourcesResponse->VideoSources[i].Imaging->Extension = NULL;
		trt__GetVideoSourcesResponse->VideoSources[i].Imaging->Exposure = NULL;
	}
	fprintf(stderr,"%s---%s---%d\n",__FILE__,__func__,__LINE__);
    return SOAP_OK;
	//ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tmd__GetVideoOutputs(struct soap* soap, struct _tmd__GetVideoOutputs *tmd__GetVideoOutputs, struct _tmd__GetVideoOutputsResponse *tmd__GetVideoOutputsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tmd__GetVideoSourceConfiguration(struct soap* soap, struct _tmd__GetVideoSourceConfiguration *tmd__GetVideoSourceConfiguration, struct _tmd__GetVideoSourceConfigurationResponse *tmd__GetVideoSourceConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tmd__GetVideoOutputConfiguration(struct soap* soap, struct _tmd__GetVideoOutputConfiguration *tmd__GetVideoOutputConfiguration, struct _tmd__GetVideoOutputConfigurationResponse *tmd__GetVideoOutputConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tmd__GetAudioSourceConfiguration(struct soap* soap, struct _tmd__GetAudioSourceConfiguration *tmd__GetAudioSourceConfiguration, struct _tmd__GetAudioSourceConfigurationResponse *tmd__GetAudioSourceConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tmd__GetAudioOutputConfiguration(struct soap* soap, struct _tmd__GetAudioOutputConfiguration *tmd__GetAudioOutputConfiguration, struct _tmd__GetAudioOutputConfigurationResponse *tmd__GetAudioOutputConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tmd__SetVideoSourceConfiguration(struct soap* soap, struct _tmd__SetVideoSourceConfiguration *tmd__SetVideoSourceConfiguration, struct _tmd__SetVideoSourceConfigurationResponse *tmd__SetVideoSourceConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tmd__SetVideoOutputConfiguration(struct soap* soap, struct _tmd__SetVideoOutputConfiguration *tmd__SetVideoOutputConfiguration, struct _tmd__SetVideoOutputConfigurationResponse *tmd__SetVideoOutputConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tmd__SetAudioSourceConfiguration(struct soap* soap, struct _tmd__SetAudioSourceConfiguration *tmd__SetAudioSourceConfiguration, struct _tmd__SetAudioSourceConfigurationResponse *tmd__SetAudioSourceConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tmd__SetAudioOutputConfiguration(struct soap* soap, struct _tmd__SetAudioOutputConfiguration *tmd__SetAudioOutputConfiguration, struct _tmd__SetAudioOutputConfigurationResponse *tmd__SetAudioOutputConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tmd__GetVideoSourceConfigurationOptions(struct soap* soap, struct _tmd__GetVideoSourceConfigurationOptions *tmd__GetVideoSourceConfigurationOptions, struct _tmd__GetVideoSourceConfigurationOptionsResponse *tmd__GetVideoSourceConfigurationOptionsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tmd__GetVideoOutputConfigurationOptions(struct soap* soap, struct _tmd__GetVideoOutputConfigurationOptions *tmd__GetVideoOutputConfigurationOptions, struct _tmd__GetVideoOutputConfigurationOptionsResponse *tmd__GetVideoOutputConfigurationOptionsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tmd__GetAudioSourceConfigurationOptions(struct soap* soap, struct _tmd__GetAudioSourceConfigurationOptions *tmd__GetAudioSourceConfigurationOptions, struct _tmd__GetAudioSourceConfigurationOptionsResponse *tmd__GetAudioSourceConfigurationOptionsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tmd__GetAudioOutputConfigurationOptions(struct soap* soap, struct _tmd__GetAudioOutputConfigurationOptions *tmd__GetAudioOutputConfigurationOptions, struct _tmd__GetAudioOutputConfigurationOptionsResponse *tmd__GetAudioOutputConfigurationOptionsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tmd__GetRelayOutputs(struct soap* soap, struct _tds__GetRelayOutputs *tds__GetRelayOutputs, struct _tds__GetRelayOutputsResponse *tds__GetRelayOutputsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tmd__SetRelayOutputSettings(struct soap* soap, struct _tmd__SetRelayOutputSettings *tmd__SetRelayOutputSettings, struct _tmd__SetRelayOutputSettingsResponse *tmd__SetRelayOutputSettingsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tmd__SetRelayOutputState(struct soap* soap, struct _tds__SetRelayOutputState *tds__SetRelayOutputState, struct _tds__SetRelayOutputStateResponse *tds__SetRelayOutputStateResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tptz__GetServiceCapabilities(struct soap* soap, struct _tptz__GetServiceCapabilities *tptz__GetServiceCapabilities, struct _tptz__GetServiceCapabilitiesResponse *tptz__GetServiceCapabilitiesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tptz__GetConfigurations(struct soap* soap, struct _tptz__GetConfigurations *tptz__GetConfigurations, struct _tptz__GetConfigurationsResponse *tptz__GetConfigurationsResponse)
{
	//wsr add
	tptz__GetConfigurationsResponse->__sizePTZConfiguration = 1;
	tptz__GetConfigurationsResponse->PTZConfiguration = (struct tt__PTZConfiguration *)soap_malloc(soap, sizeof(struct tt__PTZConfiguration));
	tptz__GetConfigurationsResponse->PTZConfiguration->Name = (char*)soap_malloc(soap,sizeof(char)*VIDEO_NAME_LEN);
	strcpy(tptz__GetConfigurationsResponse->PTZConfiguration->Name,onvifConfig.PtzProfile.Pname);
	tptz__GetConfigurationsResponse->PTZConfiguration->UseCount = 1;
	tptz__GetConfigurationsResponse->PTZConfiguration->token = (char*)soap_malloc(soap,sizeof(char)*VIDEO_NAME_LEN);
	strcpy(tptz__GetConfigurationsResponse->PTZConfiguration->token,onvifConfig.PtzProfile.Ptoken);
	tptz__GetConfigurationsResponse->PTZConfiguration->NodeToken = (char*)soap_malloc(soap,sizeof(char)*VIDEO_NAME_LEN);
	strcpy(tptz__GetConfigurationsResponse->PTZConfiguration->NodeToken,onvifConfig.PtzProfile.PnodeToken);
	tptz__GetConfigurationsResponse->PTZConfiguration->DefaultAbsolutePantTiltPositionSpace = "http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace";
	tptz__GetConfigurationsResponse->PTZConfiguration->DefaultAbsoluteZoomPositionSpace = "http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace";
	tptz__GetConfigurationsResponse->PTZConfiguration->DefaultRelativePanTiltTranslationSpace = "http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace";
	tptz__GetConfigurationsResponse->PTZConfiguration->DefaultRelativeZoomTranslationSpace = "http://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace";
	tptz__GetConfigurationsResponse->PTZConfiguration->DefaultContinuousPanTiltVelocitySpace = "http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace";
	tptz__GetConfigurationsResponse->PTZConfiguration->DefaultContinuousZoomVelocitySpace = "http://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace";
	tptz__GetConfigurationsResponse->PTZConfiguration->DefaultPTZSpeed = NULL ;
	//tptz__GetConfigurationsResponse->PTZConfiguration->DefaultPTZSpeed = (struct tt__PTZSpeed *)soap_malloc(soap, sizeof(stuct tt__PTZSpeed)) ;
	tptz__GetConfigurationsResponse->PTZConfiguration->DefaultPTZTimeout= NULL ;
	tptz__GetConfigurationsResponse->PTZConfiguration->PanTiltLimits = NULL ;
	tptz__GetConfigurationsResponse->PTZConfiguration->ZoomLimits = NULL ;
	tptz__GetConfigurationsResponse->PTZConfiguration->Extension = NULL ;
	tptz__GetConfigurationsResponse->PTZConfiguration->__anyAttribute = NULL;
	//onvif_fault(soap,"ter:ActionNotSupported", "ter:PTZNotSupported");
	return SOAP_OK;
	//ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tptz__GetPresets(struct soap* soap, struct _tptz__GetPresets *tptz__GetPresets, struct _tptz__GetPresetsResponse *tptz__GetPresetsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tptz__SetPreset(struct soap* soap, struct _tptz__SetPreset *tptz__SetPreset, struct _tptz__SetPresetResponse *tptz__SetPresetResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tptz__RemovePreset(struct soap* soap, struct _tptz__RemovePreset *tptz__RemovePreset, struct _tptz__RemovePresetResponse *tptz__RemovePresetResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tptz__GotoPreset(struct soap* soap, struct _tptz__GotoPreset *tptz__GotoPreset, struct _tptz__GotoPresetResponse *tptz__GotoPresetResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tptz__GetStatus(struct soap* soap, struct _tptz__GetStatus *tptz__GetStatus, struct _tptz__GetStatusResponse *tptz__GetStatusResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tptz__GetConfiguration(struct soap* soap, struct _tptz__GetConfiguration *tptz__GetConfiguration, struct _tptz__GetConfigurationResponse *tptz__GetConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tptz__GetNodes(struct soap* soap, struct _tptz__GetNodes *tptz__GetNodes, struct _tptz__GetNodesResponse *tptz__GetNodesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tptz__GetNode(struct soap* soap, struct _tptz__GetNode *tptz__GetNode, struct _tptz__GetNodeResponse *tptz__GetNodeResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tptz__SetConfiguration(struct soap* soap, struct _tptz__SetConfiguration *tptz__SetConfiguration, struct _tptz__SetConfigurationResponse *tptz__SetConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tptz__GetConfigurationOptions(struct soap* soap, struct _tptz__GetConfigurationOptions *tptz__GetConfigurationOptions, struct _tptz__GetConfigurationOptionsResponse *tptz__GetConfigurationOptionsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tptz__GotoHomePosition(struct soap* soap, struct _tptz__GotoHomePosition *tptz__GotoHomePosition, struct _tptz__GotoHomePositionResponse *tptz__GotoHomePositionResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tptz__SetHomePosition(struct soap* soap, struct _tptz__SetHomePosition *tptz__SetHomePosition, struct _tptz__SetHomePositionResponse *tptz__SetHomePositionResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tptz__ContinuousMove(struct soap* soap, struct _tptz__ContinuousMove *tptz__ContinuousMove, struct _tptz__ContinuousMoveResponse *tptz__ContinuousMoveResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tptz__RelativeMove(struct soap* soap, struct _tptz__RelativeMove *tptz__RelativeMove, struct _tptz__RelativeMoveResponse *tptz__RelativeMoveResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tptz__SendAuxiliaryCommand(struct soap* soap, struct _tptz__SendAuxiliaryCommand *tptz__SendAuxiliaryCommand, struct _tptz__SendAuxiliaryCommandResponse *tptz__SendAuxiliaryCommandResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tptz__AbsoluteMove(struct soap* soap, struct _tptz__AbsoluteMove *tptz__AbsoluteMove, struct _tptz__AbsoluteMoveResponse *tptz__AbsoluteMoveResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tptz__Stop(struct soap* soap, struct _tptz__Stop *tptz__Stop, struct _tptz__StopResponse *tptz__StopResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trc__GetServiceCapabilities(struct soap* soap, struct _trc__GetServiceCapabilities *trc__GetServiceCapabilities, struct _trc__GetServiceCapabilitiesResponse *trc__GetServiceCapabilitiesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trc__CreateRecording(struct soap* soap, struct _trc__CreateRecording *trc__CreateRecording, struct _trc__CreateRecordingResponse *trc__CreateRecordingResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trc__DeleteRecording(struct soap* soap, struct _trc__DeleteRecording *trc__DeleteRecording, struct _trc__DeleteRecordingResponse *trc__DeleteRecordingResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trc__GetRecordings(struct soap* soap, struct _trc__GetRecordings *trc__GetRecordings, struct _trc__GetRecordingsResponse *trc__GetRecordingsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trc__SetRecordingConfiguration(struct soap* soap, struct _trc__SetRecordingConfiguration *trc__SetRecordingConfiguration, struct _trc__SetRecordingConfigurationResponse *trc__SetRecordingConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trc__GetRecordingConfiguration(struct soap* soap, struct _trc__GetRecordingConfiguration *trc__GetRecordingConfiguration, struct _trc__GetRecordingConfigurationResponse *trc__GetRecordingConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trc__CreateTrack(struct soap* soap, struct _trc__CreateTrack *trc__CreateTrack, struct _trc__CreateTrackResponse *trc__CreateTrackResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trc__DeleteTrack(struct soap* soap, struct _trc__DeleteTrack *trc__DeleteTrack, struct _trc__DeleteTrackResponse *trc__DeleteTrackResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trc__GetTrackConfiguration(struct soap* soap, struct _trc__GetTrackConfiguration *trc__GetTrackConfiguration, struct _trc__GetTrackConfigurationResponse *trc__GetTrackConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trc__SetTrackConfiguration(struct soap* soap, struct _trc__SetTrackConfiguration *trc__SetTrackConfiguration, struct _trc__SetTrackConfigurationResponse *trc__SetTrackConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trc__CreateRecordingJob(struct soap* soap, struct _trc__CreateRecordingJob *trc__CreateRecordingJob, struct _trc__CreateRecordingJobResponse *trc__CreateRecordingJobResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trc__DeleteRecordingJob(struct soap* soap, struct _trc__DeleteRecordingJob *trc__DeleteRecordingJob, struct _trc__DeleteRecordingJobResponse *trc__DeleteRecordingJobResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trc__GetRecordingJobs(struct soap* soap, struct _trc__GetRecordingJobs *trc__GetRecordingJobs, struct _trc__GetRecordingJobsResponse *trc__GetRecordingJobsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trc__SetRecordingJobConfiguration(struct soap* soap, struct _trc__SetRecordingJobConfiguration *trc__SetRecordingJobConfiguration, struct _trc__SetRecordingJobConfigurationResponse *trc__SetRecordingJobConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trc__GetRecordingJobConfiguration(struct soap* soap, struct _trc__GetRecordingJobConfiguration *trc__GetRecordingJobConfiguration, struct _trc__GetRecordingJobConfigurationResponse *trc__GetRecordingJobConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trc__SetRecordingJobMode(struct soap* soap, struct _trc__SetRecordingJobMode *trc__SetRecordingJobMode, struct _trc__SetRecordingJobModeResponse *trc__SetRecordingJobModeResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trc__GetRecordingJobState(struct soap* soap, struct _trc__GetRecordingJobState *trc__GetRecordingJobState, struct _trc__GetRecordingJobStateResponse *trc__GetRecordingJobStateResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trp__GetServiceCapabilities(struct soap* soap, struct _trp__GetServiceCapabilities *trp__GetServiceCapabilities, struct _trp__GetServiceCapabilitiesResponse *trp__GetServiceCapabilitiesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trp__GetReplayUri(struct soap* soap, struct _trp__GetReplayUri *trp__GetReplayUri, struct _trp__GetReplayUriResponse *trp__GetReplayUriResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trp__GetReplayConfiguration(struct soap* soap, struct _trp__GetReplayConfiguration *trp__GetReplayConfiguration, struct _trp__GetReplayConfigurationResponse *trp__GetReplayConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trp__SetReplayConfiguration(struct soap* soap, struct _trp__SetReplayConfiguration *trp__SetReplayConfiguration, struct _trp__SetReplayConfigurationResponse *trp__SetReplayConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetServiceCapabilities(struct soap* soap, struct _trt__GetServiceCapabilities *trt__GetServiceCapabilities, struct _trt__GetServiceCapabilitiesResponse *trt__GetServiceCapabilitiesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetVideoSources(struct soap* soap, struct _trt__GetVideoSources *trt__GetVideoSources, struct _trt__GetVideoSourcesResponse *trt__GetVideoSourcesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetAudioSources(struct soap* soap, struct _trt__GetAudioSources *trt__GetAudioSources, struct _trt__GetAudioSourcesResponse *trt__GetAudioSourcesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetAudioOutputs(struct soap* soap, struct _trt__GetAudioOutputs *trt__GetAudioOutputs, struct _trt__GetAudioOutputsResponse *trt__GetAudioOutputsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__CreateProfile(struct soap* soap, struct _trt__CreateProfile *trt__CreateProfile, struct _trt__CreateProfileResponse *trt__CreateProfileResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetProfile(struct soap* soap, struct _trt__GetProfile *trt__GetProfile, struct _trt__GetProfileResponse *trt__GetProfileResponse)
{
	//wsr add
	int i;
	int Ptoken_status = 0;
	if((trt__GetProfile->ProfileToken) == NULL)
	{
		onvif_fault(soap,"ter:InvalidArgVal", "ter:InvalidInputToken");
		return SOAP_FAULT;
	}
	if(strcmp(trt__GetProfile->ProfileToken, "") == 0)
	{
		onvif_fault(soap,"ter:InvalidArgVal", "ter:InvalidInputToken");
		return SOAP_FAULT;
	}

	/* Check if ProfileToken Exist or Not */
	for(i = 0; i < onvifConfig.nProfile; i++)
	{
		if(strcmp(trt__GetProfile->ProfileToken, onvifConfig.Profile[i].profileToken) == 0)
		{
			Ptoken_status = 1;
			break;
		}
	}

	if(!Ptoken_status)
	{
		onvif_fault(soap, "ter:InvalidArgVal", "ter:NoProfile");
		return SOAP_FAULT;
	}
	fprintf(stderr,"%s----%s---%d\n",__FILE__,__func__,__LINE__);

	/*这里的ProfileToken是选定的，得到特定的profile描述*/
	//但odm单击一个profile时，需要获取，不然不会出现live video和video streaming
	trt__GetProfileResponse->Profile = (struct tt__Profile *)soap_malloc(soap,sizeof(struct tt__Profile));
	trt__GetProfileResponse->Profile->Name = (char *)soap_malloc(soap,sizeof(char)*MAX_PROF_TOKEN);
	trt__GetProfileResponse->Profile->token = (char *)soap_malloc(soap,sizeof(char)*MAX_PROF_TOKEN);
	strcpy(trt__GetProfileResponse->Profile->Name,onvifConfig.Profile[i].profileName);
	strcpy(trt__GetProfileResponse->Profile->token,onvifConfig.Profile[i].profileToken);
	trt__GetProfileResponse->Profile->fixed = (int *)soap_malloc(soap, sizeof(int));
	*trt__GetProfileResponse->Profile->fixed = xsd__boolean__false_;
	trt__GetProfileResponse->Profile->__anyAttribute = NULL;
	fprintf(stderr,"%s----%s---%d\n",__FILE__,__func__,__LINE__);
	trt__GetProfileResponse->Profile->VideoSourceConfiguration = NULL;
	trt__GetProfileResponse->Profile->AudioSourceConfiguration = NULL;
	trt__GetProfileResponse->Profile->AudioEncoderConfiguration = NULL;
	trt__GetProfileResponse->Profile->VideoAnalyticsConfiguration = NULL;
	trt__GetProfileResponse->Profile->PTZConfiguration = NULL;
	trt__GetProfileResponse->Profile->MetadataConfiguration = NULL;
	trt__GetProfileResponse->Profile->Extension = NULL;

	/*VideoEncoderConfiguration*/
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration = (struct tt__VideoEncoderConfiguration *)soap_malloc(soap,sizeof(struct tt__VideoEncoderConfiguration));
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->Name = (char *)soap_malloc(soap,sizeof(char)*MAX_PROF_TOKEN);
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->token= (char *)soap_malloc(soap,sizeof(char)*MAX_PROF_TOKEN);
	strcpy(trt__GetProfileResponse->Profile->VideoEncoderConfiguration->Name,onvifConfig.Profile[i].VECD.Vename);
	strcpy(trt__GetProfileResponse->Profile->VideoEncoderConfiguration->token,onvifConfig.Profile[i].VECD.Vetoken);
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->UseCount = onvifConfig.Profile[i].VECD.VeuserCount;
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->Quality = 10;
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->Encoding = onvifConfig.Profile[i].VECD.Vencoder;//JPEG = 0, MPEG4 = 1, H264 = 2;//wsr edit
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->Resolution = (struct tt__VideoResolution *)soap_malloc(soap, sizeof(struct tt__VideoResolution));
	fprintf(stderr,"%s----%s---%d\n",__FILE__,__func__,__LINE__);
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->Resolution->Height = onvifConfig.Profile[i].VECD.Rheight;//wsr edit
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->Resolution->Width = onvifConfig.Profile[i].VECD.Rwidth;//wsr edit
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->RateControl = (struct tt__VideoRateControl *)soap_malloc(soap, sizeof(struct tt__VideoRateControl));
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->RateControl->FrameRateLimit = onvifConfig.Profile[i].VECD.frameratelimit;
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->RateControl->EncodingInterval = onvifConfig.Profile[i].VECD.encodinginterval;
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->RateControl->BitrateLimit = onvifConfig.Profile[i].VECD.bitratelimit;
	fprintf(stderr,"%s----%s---%d\n",__FILE__,__func__,__LINE__);
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->MPEG4 = NULL;
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->H264 = NULL;
#if 1 //wsr edit
	/*可选，可以不设置*/
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->MPEG4 = (struct tt__Mpeg4Configuration *)soap_malloc(soap, sizeof(struct tt__Mpeg4Configuration));
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->MPEG4->GovLength = 1;
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->MPEG4->Mpeg4Profile = 1;
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->H264 = (struct tt__H264Configuration *)soap_malloc(soap, sizeof(struct tt__H264Configuration));
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->H264->GovLength = 1;
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->H264->H264Profile = 1;
#endif
	fprintf(stderr,"%s----%s---%d\n",__FILE__,__func__,__LINE__);
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->Multicast = (struct tt__MulticastConfiguration *)soap_malloc(soap, sizeof(struct tt__MulticastConfiguration));
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->Multicast->Address = (struct tt__IPAddress *)soap_malloc(soap, sizeof(struct tt__IPAddress));
	//trt__GetProfileResponse->Profile->VideoEncoderConfiguration->Multicast->Address->IPv4Address = (char **)soap_malloc(soap, sizeof(char *));
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->Multicast->Address->IPv4Address = (char *)soap_malloc(soap, sizeof(char) * INFO_LENGTH);
	fprintf(stderr,"%s----%s---%d\n",__FILE__,__func__,__LINE__);
	strcpy(trt__GetProfileResponse->Profile->VideoEncoderConfiguration->Multicast->Address->IPv4Address,onvifConfig.Profile[i].VECD.videoMulticastConfig.IPv4Addr);
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->Multicast->Address->IPv6Address = NULL;
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->Multicast->Address->Type = onvifConfig.Profile[i].VECD.videoMulticastConfig.nIPType;
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->Multicast->Port = onvifConfig.Profile[i].VECD.videoMulticastConfig.port;
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->Multicast->TTL = onvifConfig.Profile[i].VECD.videoMulticastConfig.ttl;
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->Multicast->AutoStart = onvifConfig.Profile[i].VECD.videoMulticastConfig.autostart;
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->Multicast->__size = 0;
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->Multicast->__any = NULL;
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->Multicast->__anyAttribute = NULL;
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->SessionTimeout = 720000;
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->__size = 0;
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->__any = NULL;
	trt__GetProfileResponse->Profile->VideoEncoderConfiguration->__anyAttribute = NULL;

	/* VideoSourceConfiguration */
	//trt__GetProfilesResponse->Profiles[i].VideoSourceConfiguration = NULL;
	trt__GetProfileResponse->Profile->VideoSourceConfiguration= (struct tt__VideoSourceConfiguration *)soap_malloc(soap,sizeof(struct tt__VideoSourceConfiguration ));
	trt__GetProfileResponse->Profile->VideoSourceConfiguration->Name = (char *)soap_malloc(soap,sizeof(char)*MAX_PROF_TOKEN);
	trt__GetProfileResponse->Profile->VideoSourceConfiguration->token = (char *)soap_malloc(soap,sizeof(char)*MAX_PROF_TOKEN);
	trt__GetProfileResponse->Profile->VideoSourceConfiguration->SourceToken = (char *)soap_malloc(soap,sizeof(char)*MAX_PROF_TOKEN);
	trt__GetProfileResponse->Profile->VideoSourceConfiguration->Bounds = (struct tt__IntRectangle *)soap_malloc(soap,sizeof(struct tt__IntRectangle));
	//trt__GetProfileResponse->Profiles[i].VideoSourceConfiguration->Extension = NULL;
	trt__GetProfileResponse->Profile->VideoSourceConfiguration->__any = NULL;
	trt__GetProfileResponse->Profile->VideoSourceConfiguration->__anyAttribute = NULL;
	trt__GetProfileResponse->Profile->VideoSourceConfiguration->__size = 0;
	/*SourceToken*/
	strcpy(trt__GetProfileResponse->Profile->VideoSourceConfiguration->Name,onvifConfig.Profile[i].VSCD.Vname);
	strcpy(trt__GetProfileResponse->Profile->VideoSourceConfiguration->token,onvifConfig.Profile[i].VSCD.Vtoken);
	strcpy(trt__GetProfileResponse->Profile->VideoSourceConfiguration->SourceToken,onvifConfig.Profile[i].VSCD.VsourceToken); /*__tmd__GetVideoSources*/
	trt__GetProfileResponse->Profile->VideoSourceConfiguration->UseCount = onvifConfig.Profile[i].VSCD.Vcount;
	trt__GetProfileResponse->Profile->VideoSourceConfiguration->Bounds->x = onvifConfig.Profile[i].VSCD.windowx;
	trt__GetProfileResponse->Profile->VideoSourceConfiguration->Bounds->y = onvifConfig.Profile[i].VSCD.windowy;
	trt__GetProfileResponse->Profile->VideoSourceConfiguration->Bounds->height = onvifConfig.Profile[i].VSCD.windowHeight;
	trt__GetProfileResponse->Profile->VideoSourceConfiguration->Bounds->width = onvifConfig.Profile[i].VSCD.windowWidth;

	fprintf(stderr,"%s---%s--%d\n",__FILE__,__func__,__LINE__);
	return SOAP_OK;
	//ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetProfiles(struct soap* soap, struct _trt__GetProfiles *trt__GetProfiles, struct _trt__GetProfilesResponse *trt__GetProfilesResponse)
{
	//wsr add
	int i;
	int size;
	char _IPAddr[LARGE_INFO_LENGTH];
	//unsigned int localIp = 0;
	//netGetIp("eth1", &localIp); //eth0 根据实际情况填充
	//sprintf(_IPAddr, "%s", inet_ntoa(*((struct in_addr *)&localIp)));
	sprintf(_IPAddr, "%s", onvifConfig.NET.IP);

	size = onvifConfig.nProfile;
	trt__GetProfilesResponse->Profiles =(struct tt__Profile *)soap_malloc(soap, sizeof(struct tt__Profile) * size);
	trt__GetProfilesResponse->__sizeProfiles = onvifConfig.nProfile;

	for(i = 0; i < onvifConfig.nProfile; i++)
	{
		trt__GetProfilesResponse->Profiles[i].Name = NULL;	/* required element of type tt:Name */
		trt__GetProfilesResponse->Profiles[i].VideoSourceConfiguration = NULL;	/* optional element of type tt:VideoSourceConfiguration */
		trt__GetProfilesResponse->Profiles[i].AudioSourceConfiguration = NULL;	/* optional element of type tt:AudioSourceConfiguration */
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration = NULL;	/* optional element of type tt:VideoEncoderConfiguration */
		trt__GetProfilesResponse->Profiles[i].AudioEncoderConfiguration = NULL;	/* optional element of type tt:AudioEncoderConfiguration */
		trt__GetProfilesResponse->Profiles[i].VideoAnalyticsConfiguration = NULL;	/* optional element of type tt:VideoAnalyticsConfiguration */
		trt__GetProfilesResponse->Profiles[i].PTZConfiguration = NULL;	/* optional element of type tt:PTZConfiguration */
		trt__GetProfilesResponse->Profiles[i].MetadataConfiguration = NULL;	/* optional element of type tt:MetadataConfiguration */
		trt__GetProfilesResponse->Profiles[i].Extension = NULL;	/* optional element of type tt:ProfileExtension */
		trt__GetProfilesResponse->Profiles[i].token = NULL;	/* required attribute of type tt:ReferenceToken */
		trt__GetProfilesResponse->Profiles[i].fixed = NULL;	/* optional attribute of type xsd:boolean */
		trt__GetProfilesResponse->Profiles[i].__anyAttribute = NULL;
		trt__GetProfilesResponse->Profiles[i].Name = (char *)soap_malloc(soap,sizeof(char)*MAX_PROF_TOKEN);
		strcpy(trt__GetProfilesResponse->Profiles[i].Name,onvifConfig.Profile[i].profileName);
		trt__GetProfilesResponse->Profiles[i].token= (char *)soap_malloc(soap,sizeof(char)*MAX_PROF_TOKEN);
		strcpy(trt__GetProfilesResponse->Profiles[i].token,onvifConfig.Profile[i].profileToken);
		trt__GetProfilesResponse->Profiles[i].fixed =(int *)soap_malloc(soap, sizeof(int));
		*trt__GetProfilesResponse->Profiles[i].fixed = xsd__boolean__false_;

		/*必须包含VideoEncoderConfiguration的配置
		不然不会出现live video 和 video streaming*/
		/*VideoEncoderConfiguration*/
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration = NULL;
#if 1
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration = (struct tt__VideoEncoderConfiguration *)soap_malloc(soap,sizeof(struct tt__VideoEncoderConfiguration));
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->Name = (char *)soap_malloc(soap,sizeof(char)*MAX_PROF_TOKEN);
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->token= (char *)soap_malloc(soap,sizeof(char)*MAX_PROF_TOKEN);
		strcpy(trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->Name,onvifConfig.Profile[i].VECD.Vename);
		strcpy(trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->token,onvifConfig.Profile[i].VECD.Vetoken);
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->UseCount = onvifConfig.Profile[i].VECD.VeuserCount;
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->Quality = 10;
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->Encoding = onvifConfig.Profile[i].VECD.Vencoder;//JPEG = 0, MPEG4 = 1, H264 = 2;//wsr edit
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->Resolution = (struct tt__VideoResolution *)soap_malloc(soap, sizeof(struct tt__VideoResolution));
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->Resolution->Height = onvifConfig.Profile[i].VECD.Rheight;//wsr edit
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->Resolution->Width = onvifConfig.Profile[i].VECD.Rwidth;//wsr edit
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->RateControl = (struct tt__VideoRateControl *)soap_malloc(soap, sizeof(struct tt__VideoRateControl));
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->RateControl->FrameRateLimit = onvifConfig.Profile[i].VECD.frameratelimit;
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->RateControl->EncodingInterval = onvifConfig.Profile[i].VECD.encodinginterval;
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->RateControl->BitrateLimit = onvifConfig.Profile[i].VECD.bitratelimit;

		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->MPEG4 = NULL;
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->H264 = NULL;
#if 1
		/*可选项，可以不配置*/
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->MPEG4 = (struct tt__Mpeg4Configuration *)soap_malloc(soap, sizeof(struct tt__Mpeg4Configuration));
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->MPEG4->GovLength = onvifConfig.Profile[i].VECD.Mpeggovlength;
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->MPEG4->Mpeg4Profile = onvifConfig.Profile[i].VECD.Mpegprofile;
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->H264 = (struct tt__H264Configuration *)soap_malloc(soap, sizeof(struct tt__H264Configuration));
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->H264->GovLength = onvifConfig.Profile[i].VECD.H264govlength;
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->H264->H264Profile = onvifConfig.Profile[i].VECD.H264profile;
#endif
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->Multicast = (struct tt__MulticastConfiguration *)soap_malloc(soap, sizeof(struct tt__MulticastConfiguration));
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->Multicast->Address = (struct tt__IPAddress *)soap_malloc(soap, sizeof(struct tt__IPAddress));
		//trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->Multicast->Address->IPv4Address = (char **)soap_malloc(soap, sizeof(char *));
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->Multicast->Address->IPv4Address = (char *)soap_malloc(soap, sizeof(char) * INFO_LENGTH);
		strcpy(trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->Multicast->Address->IPv4Address,onvifConfig.Profile[i].VECD.videoMulticastConfig.IPv4Addr);
		fprintf(stderr,"%s---%s---IPV4 = %s\n",__FILE__,__func__,_IPAddr);
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->Multicast->Address->IPv6Address = NULL;
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->Multicast->Address->Type = onvifConfig.Profile[i].VECD.videoMulticastConfig.nIPType;
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->Multicast->Port = onvifConfig.Profile[i].VECD.videoMulticastConfig.port;
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->Multicast->TTL = onvifConfig.Profile[i].VECD.videoMulticastConfig.ttl;
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->Multicast->AutoStart = onvifConfig.Profile[i].VECD.videoMulticastConfig.autostart;
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->Multicast->__size = 0;
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->Multicast->__any = NULL;
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->Multicast->__anyAttribute = NULL;
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->SessionTimeout = 720000;
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->__size = 0;
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->__any = NULL;
		trt__GetProfilesResponse->Profiles[i].VideoEncoderConfiguration->__anyAttribute = NULL;
#endif

		/* VideoSourceConfiguration */
		//trt__GetProfilesResponse->Profiles[i].VideoSourceConfiguration = NULL;
		trt__GetProfilesResponse->Profiles[i].VideoSourceConfiguration = (struct tt__VideoSourceConfiguration *)soap_malloc(soap,sizeof(struct tt__VideoSourceConfiguration ));
		trt__GetProfilesResponse->Profiles[i].VideoSourceConfiguration->Name = (char *)soap_malloc(soap,sizeof(char)*MAX_PROF_TOKEN);
		trt__GetProfilesResponse->Profiles[i].VideoSourceConfiguration->token = (char *)soap_malloc(soap,sizeof(char)*MAX_PROF_TOKEN);
		trt__GetProfilesResponse->Profiles[i].VideoSourceConfiguration->SourceToken = (char *)soap_malloc(soap,sizeof(char)*MAX_PROF_TOKEN);
		trt__GetProfilesResponse->Profiles[i].VideoSourceConfiguration->Bounds = (struct tt__IntRectangle *)soap_malloc(soap,sizeof(struct tt__IntRectangle));
		//trt__GetProfilesResponse->Profiles[i].VideoSourceConfiguration->Extension = NULL;
		trt__GetProfilesResponse->Profiles[i].VideoSourceConfiguration->__any = NULL;
		trt__GetProfilesResponse->Profiles[i].VideoSourceConfiguration->__anyAttribute = NULL;
		trt__GetProfilesResponse->Profiles[i].VideoSourceConfiguration->__size = 0;
		/*注意SourceToken*/
		strcpy(trt__GetProfilesResponse->Profiles[i].VideoSourceConfiguration->Name,onvifConfig.Profile[i].VSCD.Vname);
		strcpy(trt__GetProfilesResponse->Profiles[i].VideoSourceConfiguration->token,onvifConfig.Profile[i].VSCD.Vtoken);
		strcpy(trt__GetProfilesResponse->Profiles[i].VideoSourceConfiguration->SourceToken,onvifConfig.Profile[i].VSCD.VsourceToken); /*必须与__tmd__GetVideoSources中的token相同*/
		trt__GetProfilesResponse->Profiles[i].VideoSourceConfiguration->UseCount = onvifConfig.Profile[i].VSCD.Vcount;
		trt__GetProfilesResponse->Profiles[i].VideoSourceConfiguration->Bounds->x = onvifConfig.Profile[i].VSCD.windowx;
		trt__GetProfilesResponse->Profiles[i].VideoSourceConfiguration->Bounds->y = onvifConfig.Profile[i].VSCD.windowy;
		trt__GetProfilesResponse->Profiles[i].VideoSourceConfiguration->Bounds->height = onvifConfig.Profile[i].VSCD.windowHeight;
		trt__GetProfilesResponse->Profiles[i].VideoSourceConfiguration->Bounds->width = onvifConfig.Profile[i].VSCD.windowWidth;
	}

	fprintf(stderr,"%s---%s---%d\n",__FILE__,__func__,__LINE__);
	return SOAP_OK;
	//ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__AddVideoEncoderConfiguration(struct soap* soap, struct _trt__AddVideoEncoderConfiguration *trt__AddVideoEncoderConfiguration, struct _trt__AddVideoEncoderConfigurationResponse *trt__AddVideoEncoderConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__AddVideoSourceConfiguration(struct soap* soap, struct _trt__AddVideoSourceConfiguration *trt__AddVideoSourceConfiguration, struct _trt__AddVideoSourceConfigurationResponse *trt__AddVideoSourceConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__AddAudioEncoderConfiguration(struct soap* soap, struct _trt__AddAudioEncoderConfiguration *trt__AddAudioEncoderConfiguration, struct _trt__AddAudioEncoderConfigurationResponse *trt__AddAudioEncoderConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__AddAudioSourceConfiguration(struct soap* soap, struct _trt__AddAudioSourceConfiguration *trt__AddAudioSourceConfiguration, struct _trt__AddAudioSourceConfigurationResponse *trt__AddAudioSourceConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__AddPTZConfiguration(struct soap* soap, struct _trt__AddPTZConfiguration *trt__AddPTZConfiguration, struct _trt__AddPTZConfigurationResponse *trt__AddPTZConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__AddVideoAnalyticsConfiguration(struct soap* soap, struct _trt__AddVideoAnalyticsConfiguration *trt__AddVideoAnalyticsConfiguration, struct _trt__AddVideoAnalyticsConfigurationResponse *trt__AddVideoAnalyticsConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__AddMetadataConfiguration(struct soap* soap, struct _trt__AddMetadataConfiguration *trt__AddMetadataConfiguration, struct _trt__AddMetadataConfigurationResponse *trt__AddMetadataConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__AddAudioOutputConfiguration(struct soap* soap, struct _trt__AddAudioOutputConfiguration *trt__AddAudioOutputConfiguration, struct _trt__AddAudioOutputConfigurationResponse *trt__AddAudioOutputConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__AddAudioDecoderConfiguration(struct soap* soap, struct _trt__AddAudioDecoderConfiguration *trt__AddAudioDecoderConfiguration, struct _trt__AddAudioDecoderConfigurationResponse *trt__AddAudioDecoderConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__RemoveVideoEncoderConfiguration(struct soap* soap, struct _trt__RemoveVideoEncoderConfiguration *trt__RemoveVideoEncoderConfiguration, struct _trt__RemoveVideoEncoderConfigurationResponse *trt__RemoveVideoEncoderConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__RemoveVideoSourceConfiguration(struct soap* soap, struct _trt__RemoveVideoSourceConfiguration *trt__RemoveVideoSourceConfiguration, struct _trt__RemoveVideoSourceConfigurationResponse *trt__RemoveVideoSourceConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__RemoveAudioEncoderConfiguration(struct soap* soap, struct _trt__RemoveAudioEncoderConfiguration *trt__RemoveAudioEncoderConfiguration, struct _trt__RemoveAudioEncoderConfigurationResponse *trt__RemoveAudioEncoderConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__RemoveAudioSourceConfiguration(struct soap* soap, struct _trt__RemoveAudioSourceConfiguration *trt__RemoveAudioSourceConfiguration, struct _trt__RemoveAudioSourceConfigurationResponse *trt__RemoveAudioSourceConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__RemovePTZConfiguration(struct soap* soap, struct _trt__RemovePTZConfiguration *trt__RemovePTZConfiguration, struct _trt__RemovePTZConfigurationResponse *trt__RemovePTZConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__RemoveVideoAnalyticsConfiguration(struct soap* soap, struct _trt__RemoveVideoAnalyticsConfiguration *trt__RemoveVideoAnalyticsConfiguration, struct _trt__RemoveVideoAnalyticsConfigurationResponse *trt__RemoveVideoAnalyticsConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__RemoveMetadataConfiguration(struct soap* soap, struct _trt__RemoveMetadataConfiguration *trt__RemoveMetadataConfiguration, struct _trt__RemoveMetadataConfigurationResponse *trt__RemoveMetadataConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__RemoveAudioOutputConfiguration(struct soap* soap, struct _trt__RemoveAudioOutputConfiguration *trt__RemoveAudioOutputConfiguration, struct _trt__RemoveAudioOutputConfigurationResponse *trt__RemoveAudioOutputConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__RemoveAudioDecoderConfiguration(struct soap* soap, struct _trt__RemoveAudioDecoderConfiguration *trt__RemoveAudioDecoderConfiguration, struct _trt__RemoveAudioDecoderConfigurationResponse *trt__RemoveAudioDecoderConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__DeleteProfile(struct soap* soap, struct _trt__DeleteProfile *trt__DeleteProfile, struct _trt__DeleteProfileResponse *trt__DeleteProfileResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetVideoSourceConfigurations(struct soap* soap, struct _trt__GetVideoSourceConfigurations *trt__GetVideoSourceConfigurations, struct _trt__GetVideoSourceConfigurationsResponse *trt__GetVideoSourceConfigurationsResponse)
{
	//wsr add
	fprintf(stderr,"%s---%s---In\n",__FILE__,__func__);
	//该函数必要，live video需要
	int num_tokens = 0;
	int num = 0;

	num_tokens = onvifConfig.nProfile;
	trt__GetVideoSourceConfigurationsResponse->Configurations = (struct tt__VideoSourceConfiguration*)soap_malloc(soap,(num_tokens * sizeof(struct tt__VideoSourceConfiguration)));
	for(num = 0; num < num_tokens; num++)
	{
		trt__GetVideoSourceConfigurationsResponse->Configurations[num].Name = (char *)soap_malloc(soap,sizeof(char)*MAX_PROF_TOKEN);
		strcpy(trt__GetVideoSourceConfigurationsResponse->Configurations[num].Name,onvifConfig.Profile[num].VSCD.Vname);
		trt__GetVideoSourceConfigurationsResponse->Configurations[num].UseCount = onvifConfig.Profile[num].VSCD.Vcount;
		trt__GetVideoSourceConfigurationsResponse->Configurations[num].token = (char *)soap_malloc(soap,sizeof(char)*MAX_PROF_TOKEN);
		strcpy(trt__GetVideoSourceConfigurationsResponse->Configurations[num].token,onvifConfig.Profile[num].VSCD.Vtoken);
		trt__GetVideoSourceConfigurationsResponse->Configurations[num].SourceToken = (char *)soap_malloc(soap,sizeof(char)*MAX_PROF_TOKEN);
		strcpy(trt__GetVideoSourceConfigurationsResponse->Configurations[num].SourceToken,onvifConfig.Profile[num].VSCD.VsourceToken);
		trt__GetVideoSourceConfigurationsResponse->Configurations[num].Bounds = (struct tt__IntRectangle *)soap_malloc(soap, sizeof(struct tt__IntRectangle));
		trt__GetVideoSourceConfigurationsResponse->Configurations[num].Bounds->x = onvifConfig.Profile[num].VSCD.windowx;
		trt__GetVideoSourceConfigurationsResponse->Configurations[num].Bounds->y = onvifConfig.Profile[num].VSCD.windowy;
		trt__GetVideoSourceConfigurationsResponse->Configurations[num].Bounds->width = onvifConfig.Profile[num].VSCD.windowWidth;//wsr edit
		trt__GetVideoSourceConfigurationsResponse->Configurations[num].Bounds->height = onvifConfig.Profile[num].VSCD.windowHeight;//wsr edit
		trt__GetVideoSourceConfigurationsResponse->Configurations[num].__size = 0;
		trt__GetVideoSourceConfigurationsResponse->Configurations[num].__any = NULL;
		trt__GetVideoSourceConfigurationsResponse->Configurations[num].__anyAttribute = NULL;
	}
	trt__GetVideoSourceConfigurationsResponse->__sizeConfigurations = num;
	fprintf(stderr,"%s---%s\n",__FILE__,__func__);
	return SOAP_OK;
	//ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetVideoEncoderConfigurations(struct soap* soap, struct _trt__GetVideoEncoderConfigurations *trt__GetVideoEncoderConfigurations, struct _trt__GetVideoEncoderConfigurationsResponse *trt__GetVideoEncoderConfigurationsResponse)
{
	//wsr add
	int num_tokens = 0;
	int num = 0;
	char _IPAddr[LARGE_INFO_LENGTH];
	//unsigned int localIp;
	//netGetIp("eth1", &localIp); //eth0 根据实际情况填充
	//sprintf(_IPAddr, "%s", inet_ntoa(*((struct in_addr *)&localIp)));
	sprintf(_IPAddr, "%s", onvifConfig.NET.IP);
	num_tokens = onvifConfig.nProfile;
	trt__GetVideoEncoderConfigurationsResponse->Configurations = (struct tt__VideoEncoderConfiguration *)soap_malloc(soap, (num_tokens * sizeof(struct tt__VideoEncoderConfiguration)));
	for(num = 0; num < num_tokens; num++)
	{
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].Name = (char *)soap_malloc(soap,sizeof(char)*MAX_PROF_TOKEN);
		strcpy(trt__GetVideoEncoderConfigurationsResponse->Configurations[num].Name ,onvifConfig.Profile[num].VECD.Vename);
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].UseCount = onvifConfig.Profile[num].VECD.VeuserCount;
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].token = (char *)soap_malloc(soap,sizeof(char)*MAX_PROF_TOKEN);
		strcpy(trt__GetVideoEncoderConfigurationsResponse->Configurations[num].token,onvifConfig.Profile[num].VECD.Vetoken);
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].Encoding = onvifConfig.Profile[num].VECD.Vencoder;//JPEG = 0, MPEG4 = 1, H264 = 2; //wsr edit
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].Quality = 10;
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].SessionTimeout = 720000;
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].__any = NULL;
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].__anyAttribute = NULL;
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].__size = 0;
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].Resolution = (struct tt__VideoResolution *)soap_malloc(soap, sizeof(struct tt__VideoResolution));
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].Resolution->Width = onvifConfig.Profile[num].VECD.Rwidth;//wsr edit
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].Resolution->Height = onvifConfig.Profile[num].VECD.Rheight;//wsr edit
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].RateControl = (struct tt__VideoRateControl *)soap_malloc(soap, sizeof(struct tt__VideoRateControl));
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].RateControl->FrameRateLimit = onvifConfig.Profile[num].VECD.frameratelimit;
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].RateControl->EncodingInterval = onvifConfig.Profile[num].VECD.encodinginterval; // dummy
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].RateControl->BitrateLimit = onvifConfig.Profile[num].VECD.bitratelimit;
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].MPEG4 = NULL;
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].H264 = NULL;
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].Multicast = NULL;

		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].MPEG4 = (struct tt__Mpeg4Configuration *)soap_malloc(soap, sizeof(struct tt__Mpeg4Configuration));
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].MPEG4->GovLength = onvifConfig.Profile[num].VECD.Mpeggovlength;
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].MPEG4->Mpeg4Profile = onvifConfig.Profile[num].VECD.Mpegprofile;//{tt__Mpeg4Profile__SP = 0, tt__Mpeg4Profile__ASP = 1}
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].H264 = (struct tt__H264Configuration *)soap_malloc(soap, sizeof(struct tt__H264Configuration));
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].H264->GovLength = onvifConfig.Profile[num].VECD.H264govlength;
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].H264->H264Profile = onvifConfig.Profile[num].VECD.H264profile;//Baseline = 0, Main = 1, High = 3;
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].Multicast = (struct tt__MulticastConfiguration *)soap_malloc(soap, sizeof(struct tt__MulticastConfiguration));
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].Multicast->Port = onvifConfig.Profile[num].VECD.videoMulticastConfig.port;
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].Multicast->TTL = onvifConfig.Profile[num].VECD.videoMulticastConfig.ttl;
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].Multicast->AutoStart = onvifConfig.Profile[num].VECD.videoMulticastConfig.autostart;
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].Multicast->__size = 0;
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].Multicast->__any = NULL;
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].Multicast->__anyAttribute = NULL;
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].Multicast->Address  = (struct tt__IPAddress *)soap_malloc(soap, sizeof(struct tt__IPAddress));
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].Multicast->Address->Type = onvifConfig.Profile[num].VECD.videoMulticastConfig.nIPType;
		//trt__GetVideoEncoderConfigurationsResponse->Configurations[num].Multicast->Address->IPv4Address = (char **)soap_malloc(soap, sizeof(char *));
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].Multicast->Address->IPv4Address = (char *)soap_malloc(soap, sizeof(char) * INFO_LENGTH);
		strcpy(trt__GetVideoEncoderConfigurationsResponse->Configurations[num].Multicast->Address->IPv4Address, onvifConfig.Profile[num].VECD.videoMulticastConfig.IPv4Addr);
		trt__GetVideoEncoderConfigurationsResponse->Configurations[num].Multicast->Address->IPv6Address = NULL;
	}
	trt__GetVideoEncoderConfigurationsResponse->__sizeConfigurations = num_tokens; // JPEG | MPEG4 | H264
	return SOAP_OK;
	//ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetAudioSourceConfigurations(struct soap* soap, struct _trt__GetAudioSourceConfigurations *trt__GetAudioSourceConfigurations, struct _trt__GetAudioSourceConfigurationsResponse *trt__GetAudioSourceConfigurationsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetAudioEncoderConfigurations(struct soap* soap, struct _trt__GetAudioEncoderConfigurations *trt__GetAudioEncoderConfigurations, struct _trt__GetAudioEncoderConfigurationsResponse *trt__GetAudioEncoderConfigurationsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetVideoAnalyticsConfigurations(struct soap* soap, struct _trt__GetVideoAnalyticsConfigurations *trt__GetVideoAnalyticsConfigurations, struct _trt__GetVideoAnalyticsConfigurationsResponse *trt__GetVideoAnalyticsConfigurationsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetMetadataConfigurations(struct soap* soap, struct _trt__GetMetadataConfigurations *trt__GetMetadataConfigurations, struct _trt__GetMetadataConfigurationsResponse *trt__GetMetadataConfigurationsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetAudioOutputConfigurations(struct soap* soap, struct _trt__GetAudioOutputConfigurations *trt__GetAudioOutputConfigurations, struct _trt__GetAudioOutputConfigurationsResponse *trt__GetAudioOutputConfigurationsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetAudioDecoderConfigurations(struct soap* soap, struct _trt__GetAudioDecoderConfigurations *trt__GetAudioDecoderConfigurations, struct _trt__GetAudioDecoderConfigurationsResponse *trt__GetAudioDecoderConfigurationsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetVideoSourceConfiguration(struct soap* soap, struct _trt__GetVideoSourceConfiguration *trt__GetVideoSourceConfiguration, struct _trt__GetVideoSourceConfigurationResponse *trt__GetVideoSourceConfigurationResponse)
{
	//wsr add
	fprintf(stderr,"%s---%s--In\n",__FILE__,__func__);
	int i;
	int Ptoken_exist = 0;
	for(i = 0; i <= onvifConfig.nProfile; i++)
	{
		if(strcmp(trt__GetVideoSourceConfiguration->ConfigurationToken, onvifConfig.Profile[i].VSCD.Vtoken) == 0)
		{
			Ptoken_exist = 1;
			break;
		}
	}
	/* if ConfigurationToken does not exist */
	if(!Ptoken_exist)
	{
		onvif_fault(soap,"ter:InvalidArgVal", "ter:NoConfig");
		return SOAP_FAULT;
	}
	trt__GetVideoSourceConfigurationResponse->Configuration = (struct tt__VideoSourceConfiguration *)soap_malloc(soap, sizeof(struct tt__VideoSourceConfiguration));
	trt__GetVideoSourceConfigurationResponse->Configuration->Name = (char*)soap_malloc(soap, sizeof(char)*100);
	strcpy(trt__GetVideoSourceConfigurationResponse->Configuration->Name,onvifConfig.Profile[i].VSCD.Vname);
	trt__GetVideoSourceConfigurationResponse->Configuration->UseCount = onvifConfig.Profile[i].VSCD.Vcount;//oSysInfo->Oprofile[i].AVSC.Vcount;
	trt__GetVideoSourceConfigurationResponse->Configuration->token = (char*)soap_malloc(soap, sizeof(char)*100);
	strcpy(trt__GetVideoSourceConfigurationResponse->Configuration->token,onvifConfig.Profile[i].VSCD.Vtoken);
	trt__GetVideoSourceConfigurationResponse->Configuration->SourceToken = (char*)soap_malloc(soap, sizeof(char)*100);
	strcpy(trt__GetVideoSourceConfigurationResponse->Configuration->SourceToken,onvifConfig.Profile[i].VSCD.VsourceToken);
	trt__GetVideoSourceConfigurationResponse->Configuration->Bounds = (struct tt__IntRectangle *)soap_malloc(soap, sizeof(struct tt__IntRectangle));
	trt__GetVideoSourceConfigurationResponse->Configuration->Bounds->x = onvifConfig.Profile[i].VSCD.windowx;
	trt__GetVideoSourceConfigurationResponse->Configuration->Bounds->y = onvifConfig.Profile[i].VSCD.windowy;
	trt__GetVideoSourceConfigurationResponse->Configuration->Bounds->width = onvifConfig.Profile[i].VSCD.windowWidth;
	trt__GetVideoSourceConfigurationResponse->Configuration->Bounds->height = onvifConfig.Profile[i].VSCD.windowHeight;
	trt__GetVideoSourceConfigurationResponse->Configuration->__size = 0;
	trt__GetVideoSourceConfigurationResponse->Configuration->__any = NULL;
	trt__GetVideoSourceConfigurationResponse->Configuration->__anyAttribute = NULL;
	fprintf(stderr,"%s---%s--OUT\n",__FILE__,__func__);
	return SOAP_OK;
	//ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetVideoEncoderConfiguration(struct soap* soap, struct _trt__GetVideoEncoderConfiguration *trt__GetVideoEncoderConfiguration, struct _trt__GetVideoEncoderConfigurationResponse *trt__GetVideoEncoderConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetAudioSourceConfiguration(struct soap* soap, struct _trt__GetAudioSourceConfiguration *trt__GetAudioSourceConfiguration, struct _trt__GetAudioSourceConfigurationResponse *trt__GetAudioSourceConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetAudioEncoderConfiguration(struct soap* soap, struct _trt__GetAudioEncoderConfiguration *trt__GetAudioEncoderConfiguration, struct _trt__GetAudioEncoderConfigurationResponse *trt__GetAudioEncoderConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetVideoAnalyticsConfiguration(struct soap* soap, struct _trt__GetVideoAnalyticsConfiguration *trt__GetVideoAnalyticsConfiguration, struct _trt__GetVideoAnalyticsConfigurationResponse *trt__GetVideoAnalyticsConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetMetadataConfiguration(struct soap* soap, struct _trt__GetMetadataConfiguration *trt__GetMetadataConfiguration, struct _trt__GetMetadataConfigurationResponse *trt__GetMetadataConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetAudioOutputConfiguration(struct soap* soap, struct _trt__GetAudioOutputConfiguration *trt__GetAudioOutputConfiguration, struct _trt__GetAudioOutputConfigurationResponse *trt__GetAudioOutputConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetAudioDecoderConfiguration(struct soap* soap, struct _trt__GetAudioDecoderConfiguration *trt__GetAudioDecoderConfiguration, struct _trt__GetAudioDecoderConfigurationResponse *trt__GetAudioDecoderConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetCompatibleVideoEncoderConfigurations(struct soap* soap, struct _trt__GetCompatibleVideoEncoderConfigurations *trt__GetCompatibleVideoEncoderConfigurations, struct _trt__GetCompatibleVideoEncoderConfigurationsResponse *trt__GetCompatibleVideoEncoderConfigurationsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetCompatibleVideoSourceConfigurations(struct soap* soap, struct _trt__GetCompatibleVideoSourceConfigurations *trt__GetCompatibleVideoSourceConfigurations, struct _trt__GetCompatibleVideoSourceConfigurationsResponse *trt__GetCompatibleVideoSourceConfigurationsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetCompatibleAudioEncoderConfigurations(struct soap* soap, struct _trt__GetCompatibleAudioEncoderConfigurations *trt__GetCompatibleAudioEncoderConfigurations, struct _trt__GetCompatibleAudioEncoderConfigurationsResponse *trt__GetCompatibleAudioEncoderConfigurationsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetCompatibleAudioSourceConfigurations(struct soap* soap, struct _trt__GetCompatibleAudioSourceConfigurations *trt__GetCompatibleAudioSourceConfigurations, struct _trt__GetCompatibleAudioSourceConfigurationsResponse *trt__GetCompatibleAudioSourceConfigurationsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetCompatibleVideoAnalyticsConfigurations(struct soap* soap, struct _trt__GetCompatibleVideoAnalyticsConfigurations *trt__GetCompatibleVideoAnalyticsConfigurations, struct _trt__GetCompatibleVideoAnalyticsConfigurationsResponse *trt__GetCompatibleVideoAnalyticsConfigurationsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetCompatibleMetadataConfigurations(struct soap* soap, struct _trt__GetCompatibleMetadataConfigurations *trt__GetCompatibleMetadataConfigurations, struct _trt__GetCompatibleMetadataConfigurationsResponse *trt__GetCompatibleMetadataConfigurationsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetCompatibleAudioOutputConfigurations(struct soap* soap, struct _trt__GetCompatibleAudioOutputConfigurations *trt__GetCompatibleAudioOutputConfigurations, struct _trt__GetCompatibleAudioOutputConfigurationsResponse *trt__GetCompatibleAudioOutputConfigurationsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetCompatibleAudioDecoderConfigurations(struct soap* soap, struct _trt__GetCompatibleAudioDecoderConfigurations *trt__GetCompatibleAudioDecoderConfigurations, struct _trt__GetCompatibleAudioDecoderConfigurationsResponse *trt__GetCompatibleAudioDecoderConfigurationsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__SetVideoSourceConfiguration(struct soap* soap, struct _trt__SetVideoSourceConfiguration *trt__SetVideoSourceConfiguration, struct _trt__SetVideoSourceConfigurationResponse *trt__SetVideoSourceConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__SetVideoEncoderConfiguration(struct soap* soap, struct _trt__SetVideoEncoderConfiguration *trt__SetVideoEncoderConfiguration, struct _trt__SetVideoEncoderConfigurationResponse *trt__SetVideoEncoderConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__SetAudioSourceConfiguration(struct soap* soap, struct _trt__SetAudioSourceConfiguration *trt__SetAudioSourceConfiguration, struct _trt__SetAudioSourceConfigurationResponse *trt__SetAudioSourceConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__SetAudioEncoderConfiguration(struct soap* soap, struct _trt__SetAudioEncoderConfiguration *trt__SetAudioEncoderConfiguration, struct _trt__SetAudioEncoderConfigurationResponse *trt__SetAudioEncoderConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__SetVideoAnalyticsConfiguration(struct soap* soap, struct _trt__SetVideoAnalyticsConfiguration *trt__SetVideoAnalyticsConfiguration, struct _trt__SetVideoAnalyticsConfigurationResponse *trt__SetVideoAnalyticsConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__SetMetadataConfiguration(struct soap* soap, struct _trt__SetMetadataConfiguration *trt__SetMetadataConfiguration, struct _trt__SetMetadataConfigurationResponse *trt__SetMetadataConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__SetAudioOutputConfiguration(struct soap* soap, struct _trt__SetAudioOutputConfiguration *trt__SetAudioOutputConfiguration, struct _trt__SetAudioOutputConfigurationResponse *trt__SetAudioOutputConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__SetAudioDecoderConfiguration(struct soap* soap, struct _trt__SetAudioDecoderConfiguration *trt__SetAudioDecoderConfiguration, struct _trt__SetAudioDecoderConfigurationResponse *trt__SetAudioDecoderConfigurationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetVideoSourceConfigurationOptions(struct soap* soap, struct _trt__GetVideoSourceConfigurationOptions *trt__GetVideoSourceConfigurationOptions, struct _trt__GetVideoSourceConfigurationOptionsResponse *trt__GetVideoSourceConfigurationOptionsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetVideoEncoderConfigurationOptions(struct soap* soap, struct _trt__GetVideoEncoderConfigurationOptions *trt__GetVideoEncoderConfigurationOptions, struct _trt__GetVideoEncoderConfigurationOptionsResponse *trt__GetVideoEncoderConfigurationOptionsResponse)
{
	
	//wsr add
	fprintf(stderr,"%s---%s---%d\n",__FILE__,__func__,__LINE__);
	int i;
	char JPEG_profile;
	char MPEG4_profile;
	char H264_profile;
	trt__GetVideoEncoderConfigurationOptionsResponse->Options  = (struct tt__VideoEncoderConfigurationOptions *)soap_malloc(soap, sizeof(struct tt__VideoEncoderConfigurationOptions));
	trt__GetVideoEncoderConfigurationOptionsResponse->Options->JPEG  = NULL;
	trt__GetVideoEncoderConfigurationOptionsResponse->Options->MPEG4 = NULL;
	trt__GetVideoEncoderConfigurationOptionsResponse->Options->H264  = NULL;
	trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension  = NULL;
	trt__GetVideoEncoderConfigurationOptionsResponse->Options->QualityRange = NULL;
	trt__GetVideoEncoderConfigurationOptionsResponse->Options->__anyAttribute = NULL;

	trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension = (struct								tt__VideoEncoderOptionsExtension *)soap_malloc(soap, sizeof(struct tt__VideoEncoderOptionsExtension));
	trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->JPEG	= NULL;
	trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->H264	= NULL;
	trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->MPEG4  = NULL;
	trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->__size = 0;
	trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->__any = NULL;
	trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->Extension = NULL;

	trt__GetVideoEncoderConfigurationOptionsResponse->Options->QualityRange  = (struct tt__IntRange *)soap_malloc(soap, sizeof(struct tt__IntRange));
	trt__GetVideoEncoderConfigurationOptionsResponse->Options->QualityRange->Min = 10; //dummy
	trt__GetVideoEncoderConfigurationOptionsResponse->Options->QualityRange->Max = 100; //dummy

	char PToken[SMALL_INFO_LENGTH];
	char CToken[SMALL_INFO_LENGTH];
	fprintf(stderr,"%s---%s---%d\n",__FILE__,__func__,__LINE__);
	if(trt__GetVideoEncoderConfigurationOptions->ProfileToken)
	{
		strcpy(PToken, trt__GetVideoEncoderConfigurationOptions->ProfileToken);
	}
	if(trt__GetVideoEncoderConfigurationOptions->ConfigurationToken)
	{
		strcpy(CToken, trt__GetVideoEncoderConfigurationOptions->ConfigurationToken);
	}

	for(i = 0; i < onvifConfig.nProfile; i++)
	{
		if((strcmp(PToken, onvifConfig.Profile[i].profileToken) == 0) || (strcmp(CToken, onvifConfig.Profile[i].VECD.Vetoken) == 0))
		{
			if(onvifConfig.Profile[i].VECD.Vencoder == 0)
			{
				H264_profile = 0;
				JPEG_profile = 1;
				break;
			}
			else if(onvifConfig.Profile[i].VECD.Vencoder == 1)
			{
				MPEG4_profile = 1;
			}
			else if(onvifConfig.Profile[i].VECD.Vencoder == 2)
			{
				JPEG_profile = 0;
				H264_profile = 1;
				break;
			}
		}
	}
	int j = 0;
	if(JPEG_profile)
	{
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->JPEG  = (struct tt__JpegOptions *)soap_malloc(soap, sizeof(struct tt__JpegOptions));
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->JPEG->__sizeResolutionsAvailable = 1; // 2MP(1600x1200) | 3MP(2048x1536) | 5MP(2592x1920)
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->JPEG->ResolutionsAvailable  = (struct tt__VideoResolution *)soap_malloc(soap, 1 * sizeof(struct tt__VideoResolution));

		trt__GetVideoEncoderConfigurationOptionsResponse->Options->JPEG->ResolutionsAvailable[0].Width	= onvifConfig.Profile[i].VECD.Rwidth;
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->JPEG->ResolutionsAvailable[0].Height = onvifConfig.Profile[i].VECD.Rheight;

		trt__GetVideoEncoderConfigurationOptionsResponse->Options->JPEG->FrameRateRange  = (struct tt__IntRange*)soap_malloc(soap, sizeof(struct tt__IntRange));
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->JPEG->FrameRateRange->Min = 8; //dummy
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->JPEG->FrameRateRange->Max = 30; //dummy
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->JPEG->EncodingIntervalRange	= (struct tt__IntRange*)soap_malloc(soap, sizeof(struct tt__IntRange));
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->JPEG->EncodingIntervalRange->Min = 0; //dummy
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->JPEG->EncodingIntervalRange->Max = 3; //dummy
		return SOAP_OK;
	}

	/*if(MPEG4_profile)
	{
		fprintf(stderr,"%s---%s---%d--MPEG4_profile\n",__FILE__,__func__,__LINE__);
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->MPEG4  = (struct tt__Mpeg4Options *)soap_malloc(soap, sizeof(struct tt__Mpeg4Options));
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->MPEG4 = (struct					 tt__Mpeg4Options *)soap_malloc(soap, sizeof(struct tt__Mpeg4Options));

		trt__GetVideoEncoderConfigurationOptionsResponse->Options->MPEG4->__sizeResolutionsAvailable = 1;	//720(1280x720) : D1(720x480) : SXVGA(1280x960) : 1080(1920x1080) : 720MAX60(1280x720)
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->MPEG4->ResolutionsAvailable	= (struct tt__VideoResolution *)soap_malloc(soap, 1*sizeof(struct tt__VideoResolution));
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->MPEG4->ResolutionsAvailable[0].Width  = 640;
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->MPEG4->ResolutionsAvailable[0].Height = 480;
		//trt__GetVideoEncoderConfigurationOptionsResponse->Options->MPEG4->ResolutionsAvailable[1].Width  = 720;
		//trt__GetVideoEncoderConfigurationOptionsResponse->Options->MPEG4->ResolutionsAvailable[1].Height = 480;
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->MPEG4->GovLengthRange  = (struct tt__IntRange *)soap_malloc(soap, sizeof(struct tt__IntRange));
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->MPEG4->GovLengthRange->Min = 0; //dummy
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->MPEG4->GovLengthRange->Max = 30; //dummy
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->MPEG4->FrameRateRange  = (struct tt__IntRange *)soap_malloc(soap, sizeof(struct tt__IntRange));
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->MPEG4->FrameRateRange->Min = 8; //dummy
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->MPEG4->FrameRateRange->Max = 30; //dummy
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->MPEG4->EncodingIntervalRange  = (struct tt__IntRange *)soap_malloc(soap, sizeof(struct tt__IntRange));
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->MPEG4->EncodingIntervalRange->Min = 0; //dummy
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->MPEG4->EncodingIntervalRange->Max = 3; //dummy
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->MPEG4->__sizeMpeg4ProfilesSupported = 1;
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->MPEG4->Mpeg4ProfilesSupported = (int *)soap_malloc(soap, sizeof(int));
		*trt__GetVideoEncoderConfigurationOptionsResponse->Options->MPEG4->Mpeg4ProfilesSupported = 0; //SP = 0, ASP = 1
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->MPEG4  = (struct tt__Mpeg4Options2 *)soap_malloc(soap, sizeof(struct tt__Mpeg4Options2));


		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->MPEG4->__sizeMpeg4ProfilesSupported = 0;///////
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->MPEG4->__sizeResolutionsAvailable = 0;
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->MPEG4->ResolutionsAvailable  = NULL;
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->MPEG4->__any = NULL;
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->MPEG4->__anyAttribute = NULL;
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->MPEG4->__size = 0;
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->MPEG4->GovLengthRange  = NULL;
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->MPEG4->FrameRateRange  = NULL;
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->MPEG4->EncodingIntervalRange	= NULL;
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->MPEG4->Mpeg4ProfilesSupported = NULL;
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->MPEG4->BitrateRange  = (struct tt__IntRange*)soap_malloc(soap, sizeof(struct tt__IntRange));
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->MPEG4->BitrateRange->Min = 64; //dummy
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->MPEG4->BitrateRange->Max = 12000; //dummy
		fprintf(stderr,"%s---%s---%d\n",__FILE__,__func__,__LINE__);
	}*/


	if(H264_profile)
	{
		fprintf(stderr,"%s---%s---%d---H264_profile\n",__FILE__,__func__,__LINE__);
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->H264  = (struct tt__H264Options *)soap_malloc(soap, sizeof(struct tt__H264Options));
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->H264->__sizeResolutionsAvailable = 1;	//720(1280x720) : D1(720x480) : SXVGA(1280x960) : 1080(1920x1080) : 720MAX60(1280x720)
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->H264->ResolutionsAvailable  = (struct tt__VideoResolution *)soap_malloc(soap,1* sizeof(struct tt__VideoResolution)); //wsr edit

		trt__GetVideoEncoderConfigurationOptionsResponse->Options->H264->ResolutionsAvailable[0].Width	= onvifConfig.Profile[i].VECD.Rwidth;
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->H264->ResolutionsAvailable[0].Height = onvifConfig.Profile[i].VECD.Rheight;

		trt__GetVideoEncoderConfigurationOptionsResponse->Options->H264->GovLengthRange  = (struct tt__IntRange *)soap_malloc(soap, sizeof(struct tt__IntRange));
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->H264->GovLengthRange->Min = 1; //dummy
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->H264->GovLengthRange->Max = 30; //dummy
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->H264->FrameRateRange  = (struct tt__IntRange *)soap_malloc(soap, sizeof(struct tt__IntRange));
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->H264->FrameRateRange->Min = 8; //dummy
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->H264->FrameRateRange->Max = 30; //dummy
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->H264->EncodingIntervalRange	= (struct tt__IntRange *)soap_malloc(soap, sizeof(struct tt__IntRange));
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->H264->EncodingIntervalRange->Min = 1; //dummy
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->H264->EncodingIntervalRange->Max = 3; //dummy
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->H264->__sizeH264ProfilesSupported = 1;//wsr edit 2014.04.26
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->H264->H264ProfilesSupported = (int *)soap_malloc(soap, 1 * sizeof(int));//wsr edit
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->H264->H264ProfilesSupported[0] = 1/*0*/; //Baseline = 0, Main = 1, High = 3}//wsr edit
		//ProfileIDC = 100 # Profile IDC (66=baseline, 77=main,
		//Z:\DM_365\IPNetCam\ipnc\av_capture\framework\alg\src\alg_vidEnc.c=pObj->params_h264.profileIdc = 100;

		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->H264	= (struct tt__H264Options2 *)soap_malloc(soap, sizeof(struct tt__H264Options2));
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->H264->__sizeResolutionsAvailable = 0;
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->H264->ResolutionsAvailable  = NULL;
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->H264->GovLengthRange	= NULL;
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->H264->FrameRateRange	= NULL;
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->H264->EncodingIntervalRange  = NULL;

		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->H264->BitrateRange  = (struct tt__IntRange*)soap_malloc(soap, sizeof(struct tt__IntRange));
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->H264->BitrateRange->Min = 64; //dummy
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->H264->BitrateRange->Max = 12000; //dummy
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->H264->H264ProfilesSupported = NULL;
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->H264->__any = NULL;
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->H264->__anyAttribute = NULL;
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->H264->__size = 0;
		trt__GetVideoEncoderConfigurationOptionsResponse->Options->Extension->H264->__sizeH264ProfilesSupported = 0;/////////
		fprintf(stderr,"%s---%s---%d\n",__FILE__,__func__,__LINE__);
		return SOAP_OK;
	}
	fprintf(stderr,"%s--%s---OUT\n",__FILE__,__func__);
	return SOAP_OK;
	//ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
	
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetAudioSourceConfigurationOptions(struct soap* soap, struct _trt__GetAudioSourceConfigurationOptions *trt__GetAudioSourceConfigurationOptions, struct _trt__GetAudioSourceConfigurationOptionsResponse *trt__GetAudioSourceConfigurationOptionsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetAudioEncoderConfigurationOptions(struct soap* soap, struct _trt__GetAudioEncoderConfigurationOptions *trt__GetAudioEncoderConfigurationOptions, struct _trt__GetAudioEncoderConfigurationOptionsResponse *trt__GetAudioEncoderConfigurationOptionsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetMetadataConfigurationOptions(struct soap* soap, struct _trt__GetMetadataConfigurationOptions *trt__GetMetadataConfigurationOptions, struct _trt__GetMetadataConfigurationOptionsResponse *trt__GetMetadataConfigurationOptionsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetAudioOutputConfigurationOptions(struct soap* soap, struct _trt__GetAudioOutputConfigurationOptions *trt__GetAudioOutputConfigurationOptions, struct _trt__GetAudioOutputConfigurationOptionsResponse *trt__GetAudioOutputConfigurationOptionsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetAudioDecoderConfigurationOptions(struct soap* soap, struct _trt__GetAudioDecoderConfigurationOptions *trt__GetAudioDecoderConfigurationOptions, struct _trt__GetAudioDecoderConfigurationOptionsResponse *trt__GetAudioDecoderConfigurationOptionsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetGuaranteedNumberOfVideoEncoderInstances(struct soap* soap, struct _trt__GetGuaranteedNumberOfVideoEncoderInstances *trt__GetGuaranteedNumberOfVideoEncoderInstances, struct _trt__GetGuaranteedNumberOfVideoEncoderInstancesResponse *trt__GetGuaranteedNumberOfVideoEncoderInstancesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetStreamUri(struct soap* soap, struct _trt__GetStreamUri *trt__GetStreamUri, struct _trt__GetStreamUriResponse *trt__GetStreamUriResponse)
{
	//wsr add
	char _IPAddr[INFO_LENGTH];
	int i;
	for(i = 0; i < onvifConfig.nProfile; i++)
	{
		if(strcmp(trt__GetStreamUri->ProfileToken, onvifConfig.Profile[i].profileToken) != 0)
			continue;
		else
			break;
	}
	if(i == onvifConfig.nProfile)
    {
        onvif_fault(soap,"ter:InvalidArgVal", "ter:NoProfile");
        return SOAP_FAULT;
    }
    else
    {
		sprintf(_IPAddr,"%s",onvifConfig.Profile[i].VECD.rtsp);
    }


    if(trt__GetStreamUri->StreamSetup != NULL)
    {
        if(trt__GetStreamUri->StreamSetup->Stream == 1)
        {
            onvif_fault(soap,"ter:InvalidArgVal","ter:InvalidStreamSetup");
            return SOAP_FAULT;
        }
    }

	/* Response */
	trt__GetStreamUriResponse->MediaUri = (struct tt__MediaUri *)soap_malloc(soap, sizeof(struct tt__MediaUri));
	trt__GetStreamUriResponse->MediaUri->Uri = (char *)soap_malloc(soap, sizeof(char) * LARGE_INFO_LENGTH);
    strcpy(trt__GetStreamUriResponse->MediaUri->Uri,_IPAddr);
	trt__GetStreamUriResponse->MediaUri->InvalidAfterConnect = 0;
	trt__GetStreamUriResponse->MediaUri->InvalidAfterReboot = 0;
	trt__GetStreamUriResponse->MediaUri->Timeout = 200;
	trt__GetStreamUriResponse->MediaUri->__size = 0;
	trt__GetStreamUriResponse->MediaUri->__any = NULL;
	trt__GetStreamUriResponse->MediaUri->__anyAttribute = NULL;
	return SOAP_OK;
	//ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__StartMulticastStreaming(struct soap* soap, struct _trt__StartMulticastStreaming *trt__StartMulticastStreaming, struct _trt__StartMulticastStreamingResponse *trt__StartMulticastStreamingResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__StopMulticastStreaming(struct soap* soap, struct _trt__StopMulticastStreaming *trt__StopMulticastStreaming, struct _trt__StopMulticastStreamingResponse *trt__StopMulticastStreamingResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__SetSynchronizationPoint(struct soap* soap, struct _trt__SetSynchronizationPoint *trt__SetSynchronizationPoint, struct _trt__SetSynchronizationPointResponse *trt__SetSynchronizationPointResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trt__GetSnapshotUri(struct soap* soap, struct _trt__GetSnapshotUri *trt__GetSnapshotUri, struct _trt__GetSnapshotUriResponse *trt__GetSnapshotUriResponse)
{
	//wsr add
	fprintf(stderr,"%s---%s--%d\n",__FILE__,__func__,__LINE__);
	trt__GetSnapshotUriResponse->MediaUri = (struct tt__MediaUri *)soap_malloc(soap,sizeof(struct tt__MediaUri));
	trt__GetSnapshotUriResponse->MediaUri->Uri = (char *)soap_malloc(soap,sizeof(char)*200);
	strcpy(trt__GetSnapshotUriResponse->MediaUri->Uri,"http://avatar.csdn.net/7/E/1/1_ghostyu.jpg");
	trt__GetSnapshotUriResponse->MediaUri->InvalidAfterConnect = 0;
	trt__GetSnapshotUriResponse->MediaUri->InvalidAfterReboot = 0;
	trt__GetSnapshotUriResponse->MediaUri->Timeout = 2;	//seconds
	trt__GetSnapshotUriResponse->MediaUri->__size = 0;
	trt__GetSnapshotUriResponse->MediaUri->__any = NULL;
	trt__GetSnapshotUriResponse->MediaUri->__anyAttribute = NULL;
	return SOAP_OK;
	//ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trv__GetServiceCapabilities(struct soap* soap, struct _trv__GetServiceCapabilities *trv__GetServiceCapabilities, struct _trv__GetServiceCapabilitiesResponse *trv__GetServiceCapabilitiesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trv__GetReceivers(struct soap* soap, struct _trv__GetReceivers *trv__GetReceivers, struct _trv__GetReceiversResponse *trv__GetReceiversResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trv__GetReceiver(struct soap* soap, struct _trv__GetReceiver *trv__GetReceiver, struct _trv__GetReceiverResponse *trv__GetReceiverResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trv__CreateReceiver(struct soap* soap, struct _trv__CreateReceiver *trv__CreateReceiver, struct _trv__CreateReceiverResponse *trv__CreateReceiverResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trv__DeleteReceiver(struct soap* soap, struct _trv__DeleteReceiver *trv__DeleteReceiver, struct _trv__DeleteReceiverResponse *trv__DeleteReceiverResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trv__ConfigureReceiver(struct soap* soap, struct _trv__ConfigureReceiver *trv__ConfigureReceiver, struct _trv__ConfigureReceiverResponse *trv__ConfigureReceiverResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trv__SetReceiverMode(struct soap* soap, struct _trv__SetReceiverMode *trv__SetReceiverMode, struct _trv__SetReceiverModeResponse *trv__SetReceiverModeResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __trv__GetReceiverState(struct soap* soap, struct _trv__GetReceiverState *trv__GetReceiverState, struct _trv__GetReceiverStateResponse *trv__GetReceiverStateResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tse__GetServiceCapabilities(struct soap* soap, struct _tse__GetServiceCapabilities *tse__GetServiceCapabilities, struct _tse__GetServiceCapabilitiesResponse *tse__GetServiceCapabilitiesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tse__GetRecordingSummary(struct soap* soap, struct _tse__GetRecordingSummary *tse__GetRecordingSummary, struct _tse__GetRecordingSummaryResponse *tse__GetRecordingSummaryResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tse__GetRecordingInformation(struct soap* soap, struct _tse__GetRecordingInformation *tse__GetRecordingInformation, struct _tse__GetRecordingInformationResponse *tse__GetRecordingInformationResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tse__GetMediaAttributes(struct soap* soap, struct _tse__GetMediaAttributes *tse__GetMediaAttributes, struct _tse__GetMediaAttributesResponse *tse__GetMediaAttributesResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tse__FindRecordings(struct soap* soap, struct _tse__FindRecordings *tse__FindRecordings, struct _tse__FindRecordingsResponse *tse__FindRecordingsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tse__GetRecordingSearchResults(struct soap* soap, struct _tse__GetRecordingSearchResults *tse__GetRecordingSearchResults, struct _tse__GetRecordingSearchResultsResponse *tse__GetRecordingSearchResultsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tse__FindEvents(struct soap* soap, struct _tse__FindEvents *tse__FindEvents, struct _tse__FindEventsResponse *tse__FindEventsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tse__GetEventSearchResults(struct soap* soap, struct _tse__GetEventSearchResults *tse__GetEventSearchResults, struct _tse__GetEventSearchResultsResponse *tse__GetEventSearchResultsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tse__FindPTZPosition(struct soap* soap, struct _tse__FindPTZPosition *tse__FindPTZPosition, struct _tse__FindPTZPositionResponse *tse__FindPTZPositionResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tse__GetPTZPositionSearchResults(struct soap* soap, struct _tse__GetPTZPositionSearchResults *tse__GetPTZPositionSearchResults, struct _tse__GetPTZPositionSearchResultsResponse *tse__GetPTZPositionSearchResultsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tse__GetSearchState(struct soap* soap, struct _tse__GetSearchState *tse__GetSearchState, struct _tse__GetSearchStateResponse *tse__GetSearchStateResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tse__EndSearch(struct soap* soap, struct _tse__EndSearch *tse__EndSearch, struct _tse__EndSearchResponse *tse__EndSearchResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tse__FindMetadata(struct soap* soap, struct _tse__FindMetadata *tse__FindMetadata, struct _tse__FindMetadataResponse *tse__FindMetadataResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}

SOAP_FMAC5 int SOAP_FMAC6 __tse__GetMetadataSearchResults(struct soap* soap, struct _tse__GetMetadataSearchResults *tse__GetMetadataSearchResults, struct _tse__GetMetadataSearchResultsResponse *tse__GetMetadataSearchResultsResponse)
{
	ONVIF_NOTSUPPORTED_FUNC(soap, NULL);
}
